#define SNDRV_SEQ_LFLG_OPEN (SNDRV_SEQ_LFLG_INPUT|SNDRV_SEQ_LFLG_OUTPUT)
static DEFINE_SPINLOCK(clients_lock);
-static DECLARE_MUTEX(register_mutex);
+static DEFINE_MUTEX(register_mutex);
/*
* client table
client->type = NO_CLIENT;
snd_use_lock_init(&client->use_lock);
rwlock_init(&client->ports_lock);
- init_MUTEX(&client->ports_mutex);
+ mutex_init(&client->ports_mutex);
INIT_LIST_HEAD(&client->ports_list_head);
/* find free slot in the client table */
static void seq_free_client(struct snd_seq_client * client)
{
- down(®ister_mutex);
+ mutex_lock(®ister_mutex);
switch (client->type) {
case NO_CLIENT:
snd_printk(KERN_WARNING "Seq: Trying to free unused client %d\n",
snd_printk(KERN_ERR "Seq: Trying to free client %d with undefined type = %d\n",
client->number, client->type);
}
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
snd_seq_system_client_ev_client_exit(client->number);
}
struct snd_seq_client *client;
struct snd_seq_user_client *user;
- if (down_interruptible(®ister_mutex))
+ if (mutex_lock_interruptible(®ister_mutex))
return -ERESTARTSYS;
client = seq_create_client1(-1, SNDRV_SEQ_DEFAULT_EVENTS);
if (client == NULL) {
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
return -ENOMEM; /* failure code */
}
if (user->fifo == NULL) {
seq_free_client1(client);
kfree(client);
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
return -ENOMEM;
}
}
usage_alloc(&client_usage, 1);
client->type = USER_CLIENT;
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
c = client->number;
file->private_data = client;
return snd_seq_queue_timer_set_tempo(tempo->queue, client, tempo);
}
+EXPORT_SYMBOL(snd_seq_set_queue_tempo);
+
static int snd_seq_ioctl_set_queue_tempo(struct snd_seq_client *client,
void __user *arg)
{
if (queue == NULL)
return -EINVAL;
- if (down_interruptible(&queue->timer_mutex)) {
+ if (mutex_lock_interruptible(&queue->timer_mutex)) {
queuefree(queue);
return -ERESTARTSYS;
}
timer.u.alsa.id = tmr->alsa_id;
timer.u.alsa.resolution = tmr->preferred_resolution;
}
- up(&queue->timer_mutex);
+ mutex_unlock(&queue->timer_mutex);
queuefree(queue);
if (copy_to_user(arg, &timer, sizeof(timer)))
q = queueptr(timer.queue);
if (q == NULL)
return -ENXIO;
- if (down_interruptible(&q->timer_mutex)) {
+ if (mutex_lock_interruptible(&q->timer_mutex)) {
queuefree(q);
return -ERESTARTSYS;
}
tmr->preferred_resolution = timer.u.alsa.resolution;
}
result = snd_seq_queue_timer_open(timer.queue);
- up(&q->timer_mutex);
+ mutex_unlock(&q->timer_mutex);
queuefree(q);
} else {
return -EPERM;
info.output_pool = cptr->pool->size;
info.output_room = cptr->pool->room;
info.output_free = info.output_pool;
- if (cptr->pool)
- info.output_free = snd_seq_unused_cells(cptr->pool);
+ info.output_free = snd_seq_unused_cells(cptr->pool);
if (cptr->type == USER_CLIENT) {
info.input_pool = cptr->data.user.fifo_pool_size;
info.input_free = info.input_pool;
if (card == NULL && client_index >= SNDRV_SEQ_GLOBAL_CLIENTS)
return -EINVAL;
- if (down_interruptible(®ister_mutex))
+ if (mutex_lock_interruptible(®ister_mutex))
return -ERESTARTSYS;
if (card) {
/* empty write queue as default */
client = seq_create_client1(client_index, 0);
if (client == NULL) {
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
return -EBUSY; /* failure code */
}
usage_alloc(&client_usage, 1);
va_end(args);
client->type = KERNEL_CLIENT;
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
/* make others aware this new client */
snd_seq_system_client_ev_client_start(client->number);
return client->number;
}
+EXPORT_SYMBOL(snd_seq_create_kernel_client);
+
/* exported to kernel modules */
int snd_seq_delete_kernel_client(int client)
{
return 0;
}
+EXPORT_SYMBOL(snd_seq_delete_kernel_client);
/* skeleton to enqueue event, called from snd_seq_kernel_client_enqueue
* and snd_seq_kernel_client_enqueue_blocking
return kernel_client_enqueue(client, ev, NULL, 0, atomic, hop);
}
+EXPORT_SYMBOL(snd_seq_kernel_client_enqueue);
+
/*
* exported, called by kernel clients to enqueue events (with blocking)
*
return kernel_client_enqueue(client, ev, file, 1, atomic, hop);
}
+EXPORT_SYMBOL(snd_seq_kernel_client_enqueue_blocking);
/*
* exported, called by kernel clients to dispatch events directly to other
return result;
}
+EXPORT_SYMBOL(snd_seq_kernel_client_dispatch);
/*
* exported, called by kernel clients to perform same functions as with
return result;
}
+EXPORT_SYMBOL(snd_seq_kernel_client_ctl);
/* exported (for OSS emulator) */
int snd_seq_kernel_client_write_poll(int clientid, struct file *file, poll_table *wait)
return 0;
}
+EXPORT_SYMBOL(snd_seq_kernel_client_write_poll);
+
/*---------------------------------------------------------------------------*/
#ifdef CONFIG_PROC_FS
{
struct list_head *l;
- down(&client->ports_mutex);
+ mutex_lock(&client->ports_mutex);
list_for_each(l, &client->ports_list_head) {
struct snd_seq_client_port *p = list_entry(l, struct snd_seq_client_port, list);
snd_iprintf(buffer, " Port %3d : \"%s\" (%c%c%c%c)\n",
snd_seq_info_dump_subscribers(buffer, &p->c_src, 1, " Connecting To: ");
snd_seq_info_dump_subscribers(buffer, &p->c_dest, 0, " Connected From: ");
}
- up(&client->ports_mutex);
+ mutex_unlock(&client->ports_mutex);
}
{
int err;
- if (down_interruptible(®ister_mutex))
+ if (mutex_lock_interruptible(®ister_mutex))
return -ERESTARTSYS;
if ((err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0,
&snd_seq_f_ops, NULL, "seq")) < 0) {
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
return err;
}
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
return 0;
}