~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/core/seq/seq_clientmgr.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  *   ALSA sequencer Client Manager
  4  *   Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
  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 /* client manager */
 16 
 17 struct snd_seq_user_client {
 18         struct file *file;      /* file struct of client */
 19         /* ... */
 20         struct pid *owner;
 21         
 22         /* fifo */
 23         struct snd_seq_fifo *fifo;      /* queue for incoming events */
 24         int fifo_pool_size;
 25 };
 26 
 27 struct snd_seq_kernel_client {
 28         /* ... */
 29         struct snd_card *card;
 30 };
 31 
 32 
 33 struct snd_seq_client {
 34         snd_seq_client_type_t type;
 35         unsigned int accept_input: 1,
 36                 accept_output: 1;
 37         unsigned int midi_version;
 38         unsigned int user_pversion;
 39         char name[64];          /* client name */
 40         int number;             /* client number */
 41         unsigned int filter;    /* filter flags */
 42         DECLARE_BITMAP(event_filter, 256);
 43         unsigned short group_filter;
 44         snd_use_lock_t use_lock;
 45         int event_lost;
 46         /* ports */
 47         int num_ports;          /* number of ports */
 48         struct list_head ports_list_head;
 49         rwlock_t ports_lock;
 50         struct mutex ports_mutex;
 51         struct mutex ioctl_mutex;
 52         int convert32;          /* convert 32->64bit */
 53         int ump_endpoint_port;
 54 
 55         /* output pool */
 56         struct snd_seq_pool *pool;              /* memory pool for this client */
 57 
 58         union {
 59                 struct snd_seq_user_client user;
 60                 struct snd_seq_kernel_client kernel;
 61         } data;
 62 
 63         /* for UMP */
 64         void **ump_info;
 65 };
 66 
 67 /* usage statistics */
 68 struct snd_seq_usage {
 69         int cur;
 70         int peak;
 71 };
 72 
 73 
 74 int client_init_data(void);
 75 int snd_sequencer_device_init(void);
 76 void snd_sequencer_device_done(void);
 77 
 78 /* get locked pointer to client */
 79 struct snd_seq_client *snd_seq_client_use_ptr(int clientid);
 80 
 81 /* unlock pointer to client */
 82 #define snd_seq_client_unlock(client) snd_use_lock_free(&(client)->use_lock)
 83 
 84 /* dispatch event to client(s) */
 85 int snd_seq_dispatch_event(struct snd_seq_event_cell *cell, int atomic, int hop);
 86 
 87 int snd_seq_kernel_client_write_poll(int clientid, struct file *file, poll_table *wait);
 88 int snd_seq_client_notify_subscription(int client, int port,
 89                                        struct snd_seq_port_subscribe *info, int evtype);
 90 
 91 int __snd_seq_deliver_single_event(struct snd_seq_client *dest,
 92                                    struct snd_seq_client_port *dest_port,
 93                                    struct snd_seq_event *event,
 94                                    int atomic, int hop);
 95 
 96 /* only for OSS sequencer */
 97 bool snd_seq_client_ioctl_lock(int clientid);
 98 void snd_seq_client_ioctl_unlock(int clientid);
 99 
100 extern int seq_client_load[15];
101 
102 /* for internal use between kernel sequencer clients */
103 struct snd_seq_client *snd_seq_kernel_client_get(int client);
104 void snd_seq_kernel_client_put(struct snd_seq_client *cptr);
105 
106 static inline bool snd_seq_client_is_ump(struct snd_seq_client *c)
107 {
108         return c->midi_version != SNDRV_SEQ_CLIENT_LEGACY_MIDI;
109 }
110 
111 static inline bool snd_seq_client_is_midi2(struct snd_seq_client *c)
112 {
113         return c->midi_version == SNDRV_SEQ_CLIENT_UMP_MIDI_2_0;
114 }
115 
116 #endif
117 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php