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

TOMOYO Linux Cross Reference
Linux/sound/core/seq/seq_ports.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 Ports 
  4  *   Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  5  */
  6 #ifndef __SND_SEQ_PORTS_H
  7 #define __SND_SEQ_PORTS_H
  8 
  9 #include <sound/seq_kernel.h>
 10 #include <sound/ump_convert.h>
 11 #include "seq_lock.h"
 12 
 13 /* list of 'exported' ports */
 14 
 15 /* Client ports that are not exported are still accessible, but are
 16  anonymous ports. 
 17  
 18  If a port supports SUBSCRIPTION, that port can send events to all
 19  subscribersto a special address, with address
 20  (queue==SNDRV_SEQ_ADDRESS_SUBSCRIBERS). The message is then send to all
 21  recipients that are registered in the subscription list. A typical
 22  application for these SUBSCRIPTION events is handling of incoming MIDI
 23  data. The port doesn't 'know' what other clients are interested in this
 24  message. If for instance a MIDI recording application would like to receive
 25  the events from that port, it will first have to subscribe with that port.
 26  
 27 */
 28 
 29 struct snd_seq_subscribers {
 30         struct snd_seq_port_subscribe info;     /* additional info */
 31         struct list_head src_list;      /* link of sources */
 32         struct list_head dest_list;     /* link of destinations */
 33         atomic_t ref_count;
 34 };
 35 
 36 struct snd_seq_port_subs_info {
 37         struct list_head list_head;     /* list of subscribed ports */
 38         unsigned int count;             /* count of subscribers */
 39         unsigned int exclusive: 1;      /* exclusive mode */
 40         struct rw_semaphore list_mutex;
 41         rwlock_t list_lock;
 42         int (*open)(void *private_data, struct snd_seq_port_subscribe *info);
 43         int (*close)(void *private_data, struct snd_seq_port_subscribe *info);
 44 };
 45 
 46 struct snd_seq_client_port {
 47 
 48         struct snd_seq_addr addr;       /* client/port number */
 49         struct module *owner;           /* owner of this port */
 50         char name[64];                  /* port name */ 
 51         struct list_head list;          /* port list */
 52         snd_use_lock_t use_lock;
 53 
 54         /* subscribers */
 55         struct snd_seq_port_subs_info c_src;    /* read (sender) list */
 56         struct snd_seq_port_subs_info c_dest;   /* write (dest) list */
 57 
 58         int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data,
 59                            int atomic, int hop);
 60         void (*private_free)(void *private_data);
 61         void *private_data;
 62         unsigned int closing : 1;
 63         unsigned int timestamping: 1;
 64         unsigned int time_real: 1;
 65         int time_queue;
 66         
 67         /* capability, inport, output, sync */
 68         unsigned int capability;        /* port capability bits */
 69         unsigned int type;              /* port type bits */
 70 
 71         /* supported channels */
 72         int midi_channels;
 73         int midi_voices;
 74         int synth_voices;
 75                 
 76         /* UMP direction and group */
 77         unsigned char direction;
 78         unsigned char ump_group;
 79 
 80 #if IS_ENABLED(CONFIG_SND_SEQ_UMP)
 81         struct ump_cvt_to_ump_bank midi2_bank[16]; /* per channel */
 82 #endif
 83 };
 84 
 85 struct snd_seq_client;
 86 
 87 /* return pointer to port structure and lock port */
 88 struct snd_seq_client_port *snd_seq_port_use_ptr(struct snd_seq_client *client, int num);
 89 
 90 /* search for next port - port is locked if found */
 91 struct snd_seq_client_port *snd_seq_port_query_nearest(struct snd_seq_client *client,
 92                                                        struct snd_seq_port_info *pinfo);
 93 
 94 /* unlock the port */
 95 #define snd_seq_port_unlock(port) snd_use_lock_free(&(port)->use_lock)
 96 
 97 /* create a port, port number or a negative error code is returned */
 98 int snd_seq_create_port(struct snd_seq_client *client, int port_index,
 99                         struct snd_seq_client_port **port_ret);
100 
101 /* delete a port */
102 int snd_seq_delete_port(struct snd_seq_client *client, int port);
103 
104 /* delete all ports */
105 int snd_seq_delete_all_ports(struct snd_seq_client *client);
106 
107 /* set port info fields */
108 int snd_seq_set_port_info(struct snd_seq_client_port *port,
109                           struct snd_seq_port_info *info);
110 
111 /* get port info fields */
112 int snd_seq_get_port_info(struct snd_seq_client_port *port,
113                           struct snd_seq_port_info *info);
114 
115 /* add subscriber to subscription list */
116 int snd_seq_port_connect(struct snd_seq_client *caller,
117                          struct snd_seq_client *s, struct snd_seq_client_port *sp,
118                          struct snd_seq_client *d, struct snd_seq_client_port *dp,
119                          struct snd_seq_port_subscribe *info);
120 
121 /* remove subscriber from subscription list */ 
122 int snd_seq_port_disconnect(struct snd_seq_client *caller,
123                             struct snd_seq_client *s, struct snd_seq_client_port *sp,
124                             struct snd_seq_client *d, struct snd_seq_client_port *dp,
125                             struct snd_seq_port_subscribe *info);
126 
127 /* subscribe port */
128 int snd_seq_port_subscribe(struct snd_seq_client_port *port,
129                            struct snd_seq_port_subscribe *info);
130 
131 /* get matched subscriber */
132 int snd_seq_port_get_subscription(struct snd_seq_port_subs_info *src_grp,
133                                   struct snd_seq_addr *dest_addr,
134                                   struct snd_seq_port_subscribe *subs);
135 
136 #endif
137 

~ [ 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