X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fcore%2Fseq%2Fseq_ports.h;h=9d7117118ba481a9b25aef7d757730cc48d8139f;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=89fd4416f6fa3b9fe9cb709748c595d81b10aea0;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/sound/core/seq/seq_ports.h b/sound/core/seq/seq_ports.h index 89fd4416f..9d7117118 100644 --- a/sound/core/seq/seq_ports.h +++ b/sound/core/seq/seq_ports.h @@ -40,37 +40,38 @@ */ -typedef struct subscribers_t { - snd_seq_port_subscribe_t info; /* additional info */ +struct snd_seq_subscribers { + struct snd_seq_port_subscribe info; /* additional info */ struct list_head src_list; /* link of sources */ struct list_head dest_list; /* link of destinations */ atomic_t ref_count; -} subscribers_t; +}; -typedef struct port_subs_info_t { +struct snd_seq_port_subs_info { struct list_head list_head; /* list of subscribed ports */ unsigned int count; /* count of subscribers */ unsigned int exclusive: 1; /* exclusive mode */ struct rw_semaphore list_mutex; rwlock_t list_lock; - snd_seq_kernel_port_open_t *open; - snd_seq_kernel_port_close_t *close; -} port_subs_info_t; + int (*open)(void *private_data, struct snd_seq_port_subscribe *info); + int (*close)(void *private_data, struct snd_seq_port_subscribe *info); +}; -typedef struct client_port_t { +struct snd_seq_client_port { - snd_seq_addr_t addr; /* client/port number */ + struct snd_seq_addr addr; /* client/port number */ struct module *owner; /* owner of this port */ char name[64]; /* port name */ struct list_head list; /* port list */ snd_use_lock_t use_lock; /* subscribers */ - port_subs_info_t c_src; /* read (sender) list */ - port_subs_info_t c_dest; /* write (dest) list */ + struct snd_seq_port_subs_info c_src; /* read (sender) list */ + struct snd_seq_port_subs_info c_dest; /* write (dest) list */ - snd_seq_kernel_port_input_t *event_input; - snd_seq_kernel_port_private_free_t *private_free; + int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data, + int atomic, int hop); + void (*private_free)(void *private_data); void *private_data; unsigned int callback_all : 1; unsigned int closing : 1; @@ -87,42 +88,55 @@ typedef struct client_port_t { int midi_voices; int synth_voices; -} client_port_t; +}; + +struct snd_seq_client; /* return pointer to port structure and lock port */ -client_port_t *snd_seq_port_use_ptr(client_t *client, int num); +struct snd_seq_client_port *snd_seq_port_use_ptr(struct snd_seq_client *client, int num); /* search for next port - port is locked if found */ -client_port_t *snd_seq_port_query_nearest(client_t *client, snd_seq_port_info_t *pinfo); +struct snd_seq_client_port *snd_seq_port_query_nearest(struct snd_seq_client *client, + struct snd_seq_port_info *pinfo); /* unlock the port */ #define snd_seq_port_unlock(port) snd_use_lock_free(&(port)->use_lock) /* create a port, port number is returned (-1 on failure) */ -client_port_t *snd_seq_create_port(client_t *client, int port_index); +struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client, int port_index); /* delete a port */ -int snd_seq_delete_port(client_t *client, int port); +int snd_seq_delete_port(struct snd_seq_client *client, int port); /* delete all ports */ -int snd_seq_delete_all_ports(client_t *client); +int snd_seq_delete_all_ports(struct snd_seq_client *client); /* set port info fields */ -int snd_seq_set_port_info(client_port_t *port, snd_seq_port_info_t *info); +int snd_seq_set_port_info(struct snd_seq_client_port *port, + struct snd_seq_port_info *info); /* get port info fields */ -int snd_seq_get_port_info(client_port_t *port, snd_seq_port_info_t *info); +int snd_seq_get_port_info(struct snd_seq_client_port *port, + struct snd_seq_port_info *info); /* add subscriber to subscription list */ -int snd_seq_port_connect(client_t *caller, client_t *s, client_port_t *sp, client_t *d, client_port_t *dp, snd_seq_port_subscribe_t *info); +int snd_seq_port_connect(struct snd_seq_client *caller, + struct snd_seq_client *s, struct snd_seq_client_port *sp, + struct snd_seq_client *d, struct snd_seq_client_port *dp, + struct snd_seq_port_subscribe *info); /* remove subscriber from subscription list */ -int snd_seq_port_disconnect(client_t *caller, client_t *s, client_port_t *sp, client_t *d, client_port_t *dp, snd_seq_port_subscribe_t *info); +int snd_seq_port_disconnect(struct snd_seq_client *caller, + struct snd_seq_client *s, struct snd_seq_client_port *sp, + struct snd_seq_client *d, struct snd_seq_client_port *dp, + struct snd_seq_port_subscribe *info); /* subscribe port */ -int snd_seq_port_subscribe(client_port_t *port, snd_seq_port_subscribe_t *info); +int snd_seq_port_subscribe(struct snd_seq_client_port *port, + struct snd_seq_port_subscribe *info); /* get matched subscriber */ -subscribers_t *snd_seq_port_get_subscription(port_subs_info_t *src_grp, snd_seq_addr_t *dest_addr); +struct snd_seq_subscribers *snd_seq_port_get_subscription(struct snd_seq_port_subs_info *src_grp, + struct snd_seq_addr *dest_addr); #endif