Lines Matching refs:client

81 static int bounce_error_event(struct snd_seq_client *client,
84 static int snd_seq_deliver_single_event(struct snd_seq_client *client,
102 static inline int snd_seq_write_pool_allocated(struct snd_seq_client *client) in snd_seq_write_pool_allocated() argument
104 return snd_seq_total_cells(client->pool) > 0; in snd_seq_write_pool_allocated()
121 struct snd_seq_client *client; in snd_seq_client_use_ptr() local
129 client = clientptr(clientid); in snd_seq_client_use_ptr()
130 if (client) in snd_seq_client_use_ptr()
168 client = clientptr(clientid); in snd_seq_client_use_ptr()
169 if (client) in snd_seq_client_use_ptr()
177 snd_use_lock_use(&client->use_lock); in snd_seq_client_use_ptr()
179 return client; in snd_seq_client_use_ptr()
208 struct snd_seq_client *client; in seq_create_client1() local
211 client = kzalloc(sizeof(*client), GFP_KERNEL); in seq_create_client1()
212 if (client == NULL) in seq_create_client1()
214 client->pool = snd_seq_pool_new(poolsize); in seq_create_client1()
215 if (client->pool == NULL) { in seq_create_client1()
216 kfree(client); in seq_create_client1()
219 client->type = NO_CLIENT; in seq_create_client1()
220 snd_use_lock_init(&client->use_lock); in seq_create_client1()
221 rwlock_init(&client->ports_lock); in seq_create_client1()
222 mutex_init(&client->ports_mutex); in seq_create_client1()
223 INIT_LIST_HEAD(&client->ports_list_head); in seq_create_client1()
224 mutex_init(&client->ioctl_mutex); in seq_create_client1()
234 clienttab[client->number = c] = client; in seq_create_client1()
236 return client; in seq_create_client1()
240 clienttab[client->number = client_index] = client; in seq_create_client1()
242 return client; in seq_create_client1()
246 snd_seq_pool_delete(&client->pool); in seq_create_client1()
247 kfree(client); in seq_create_client1()
252 static int seq_free_client1(struct snd_seq_client *client) in seq_free_client1() argument
256 if (!client) in seq_free_client1()
259 clienttablock[client->number] = 1; in seq_free_client1()
260 clienttab[client->number] = NULL; in seq_free_client1()
262 snd_seq_delete_all_ports(client); in seq_free_client1()
263 snd_seq_queue_client_leave(client->number); in seq_free_client1()
264 snd_use_lock_sync(&client->use_lock); in seq_free_client1()
265 snd_seq_queue_client_termination(client->number); in seq_free_client1()
266 if (client->pool) in seq_free_client1()
267 snd_seq_pool_delete(&client->pool); in seq_free_client1()
269 clienttablock[client->number] = 0; in seq_free_client1()
275 static void seq_free_client(struct snd_seq_client * client) in seq_free_client() argument
278 switch (client->type) { in seq_free_client()
281 client->number); in seq_free_client()
285 seq_free_client1(client); in seq_free_client()
291 client->number, client->type); in seq_free_client()
295 snd_seq_system_client_ev_client_exit(client->number); in seq_free_client()
306 struct snd_seq_client *client; in snd_seq_open() local
315 client = seq_create_client1(-1, SNDRV_SEQ_DEFAULT_EVENTS); in snd_seq_open()
316 if (!client) { in snd_seq_open()
323 client->accept_input = 1; in snd_seq_open()
325 client->accept_output = 1; in snd_seq_open()
327 user = &client->data.user; in snd_seq_open()
335 seq_free_client1(client); in snd_seq_open()
336 kfree(client); in snd_seq_open()
343 client->type = USER_CLIENT; in snd_seq_open()
346 c = client->number; in snd_seq_open()
347 file->private_data = client; in snd_seq_open()
351 sprintf(client->name, "Client-%d", c); in snd_seq_open()
352 client->data.user.owner = get_pid(task_pid(current)); in snd_seq_open()
363 struct snd_seq_client *client = file->private_data; in snd_seq_release() local
365 if (client) { in snd_seq_release()
366 seq_free_client(client); in snd_seq_release()
367 if (client->data.user.fifo) in snd_seq_release()
368 snd_seq_fifo_delete(&client->data.user.fifo); in snd_seq_release()
369 put_pid(client->data.user.owner); in snd_seq_release()
370 kfree(client); in snd_seq_release()
387 struct snd_seq_client *client = file->private_data; in snd_seq_read() local
400 if (snd_BUG_ON(!client)) in snd_seq_read()
403 if (!client->accept_input || (fifo = client->data.user.fifo) == NULL) in snd_seq_read()
487 dest = snd_seq_client_use_ptr(event->dest.client); in get_event_dest_client()
516 static int bounce_error_event(struct snd_seq_client *client, in bounce_error_event() argument
523 if (client == NULL || in bounce_error_event()
524 ! (client->filter & SNDRV_SEQ_FILTER_BOUNCE) || in bounce_error_event()
525 ! client->accept_input) in bounce_error_event()
533 bounce_ev.source.client = SNDRV_SEQ_CLIENT_SYSTEM; in bounce_error_event()
535 bounce_ev.dest.client = client->number; in bounce_error_event()
542 client->event_lost++; in bounce_error_event()
584 static int snd_seq_deliver_single_event(struct snd_seq_client *client, in snd_seq_deliver_single_event() argument
636 result = bounce_error_event(client, event, result, atomic, hop); in snd_seq_deliver_single_event()
645 static int deliver_to_subscribers(struct snd_seq_client *client, in deliver_to_subscribers() argument
655 src_port = snd_seq_port_use_ptr(client, event->source.port); in deliver_to_subscribers()
676 err = snd_seq_deliver_single_event(client, event, in deliver_to_subscribers()
702 static int port_broadcast_event(struct snd_seq_client *client, in port_broadcast_event() argument
739 static int broadcast_event(struct snd_seq_client *client, in broadcast_event() argument
750 if (dest == client->number) in broadcast_event()
752 event->dest.client = dest; in broadcast_event()
755 err = port_broadcast_event(client, event, atomic, hop); in broadcast_event()
775 static int multicast_event(struct snd_seq_client *client, struct snd_seq_event *event, in multicast_event() argument
792 static int snd_seq_deliver_event(struct snd_seq_client *client, struct snd_seq_event *event, in snd_seq_deliver_event() argument
800 event->source.client, event->source.port, in snd_seq_deliver_event()
801 event->dest.client, event->dest.port); in snd_seq_deliver_event()
810 event->dest.client == SNDRV_SEQ_ADDRESS_SUBSCRIBERS) in snd_seq_deliver_event()
811 result = deliver_to_subscribers(client, event, atomic, hop); in snd_seq_deliver_event()
814 event->dest.client == SNDRV_SEQ_ADDRESS_BROADCAST) in snd_seq_deliver_event()
815 result = broadcast_event(client, event, atomic, hop); in snd_seq_deliver_event()
816 else if (event->dest.client >= SNDRV_SEQ_MAX_CLIENTS) in snd_seq_deliver_event()
817 result = multicast_event(client, event, atomic, hop); in snd_seq_deliver_event()
819 result = port_broadcast_event(client, event, atomic, hop); in snd_seq_deliver_event()
822 result = snd_seq_deliver_single_event(client, event, 0, atomic, hop); in snd_seq_deliver_event()
839 struct snd_seq_client *client; in snd_seq_dispatch_event() local
845 client = snd_seq_client_use_ptr(cell->event.source.client); in snd_seq_dispatch_event()
846 if (client == NULL) { in snd_seq_dispatch_event()
861 result = snd_seq_deliver_event(client, &tmpev, atomic, hop); in snd_seq_dispatch_event()
896 result = snd_seq_deliver_event(client, &cell->event, atomic, hop); in snd_seq_dispatch_event()
900 snd_seq_client_unlock(client); in snd_seq_dispatch_event()
909 static int snd_seq_client_enqueue_event(struct snd_seq_client *client, in snd_seq_client_enqueue_event() argument
920 event->dest.client = SNDRV_SEQ_ADDRESS_SUBSCRIBERS; in snd_seq_client_enqueue_event()
925 event->dest.client = SNDRV_SEQ_ADDRESS_BROADCAST; in snd_seq_client_enqueue_event()
929 if (event->dest.client == SNDRV_SEQ_ADDRESS_SUBSCRIBERS) { in snd_seq_client_enqueue_event()
931 struct snd_seq_client_port *src_port = snd_seq_port_use_ptr(client, event->source.port); in snd_seq_client_enqueue_event()
941 return snd_seq_deliver_event(client, event, atomic, hop); in snd_seq_client_enqueue_event()
945 if (snd_seq_queue_is_used(event->queue, client->number) <= 0) in snd_seq_client_enqueue_event()
947 if (! snd_seq_write_pool_allocated(client)) in snd_seq_client_enqueue_event()
951 err = snd_seq_event_dup(client->pool, event, &cell, !blocking || atomic, in snd_seq_client_enqueue_event()
1005 struct snd_seq_client *client = file->private_data; in snd_seq_write() local
1014 if (snd_BUG_ON(!client)) in snd_seq_write()
1017 if (!client->accept_output || client->pool == NULL) in snd_seq_write()
1021 mutex_lock(&client->ioctl_mutex); in snd_seq_write()
1022 if (client->pool->size > 0 && !snd_seq_write_pool_allocated(client)) { in snd_seq_write()
1023 err = snd_seq_pool_init(client->pool); in snd_seq_write()
1037 event.source.client = client->number; /* fill in client number */ in snd_seq_write()
1066 if (client->convert32 && snd_seq_ev_is_varusr(&event)) { in snd_seq_write()
1074 err = snd_seq_client_enqueue_event(client, &event, file, in snd_seq_write()
1076 0, 0, &client->ioctl_mutex); in snd_seq_write()
1088 mutex_unlock(&client->ioctl_mutex); in snd_seq_write()
1098 struct snd_seq_client *client = file->private_data; in snd_seq_poll() local
1102 if (snd_BUG_ON(!client)) in snd_seq_poll()
1106 client->data.user.fifo) { in snd_seq_poll()
1109 if (snd_seq_fifo_poll_wait(client->data.user.fifo, file, wait)) in snd_seq_poll()
1116 if (!snd_seq_write_pool_allocated(client) || in snd_seq_poll()
1117 snd_seq_pool_poll_wait(client->pool, file, wait)) in snd_seq_poll()
1127 static int snd_seq_ioctl_pversion(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_pversion() argument
1135 static int snd_seq_ioctl_client_id(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_client_id() argument
1139 *client_id = client->number; in snd_seq_ioctl_client_id()
1144 static int snd_seq_ioctl_system_info(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_system_info() argument
1162 static int snd_seq_ioctl_running_mode(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_running_mode() argument
1169 cptr = snd_seq_client_use_ptr(info->client); in snd_seq_ioctl_running_mode()
1199 info->client = cptr->number; in get_client_info()
1222 static int snd_seq_ioctl_get_client_info(struct snd_seq_client *client, in snd_seq_ioctl_get_client_info() argument
1229 cptr = snd_seq_client_use_ptr(client_info->client); in snd_seq_ioctl_get_client_info()
1241 static int snd_seq_ioctl_set_client_info(struct snd_seq_client *client, in snd_seq_ioctl_set_client_info() argument
1247 if (client->number != client_info->client) in snd_seq_ioctl_set_client_info()
1250 if (client->type != client_info->type) in snd_seq_ioctl_set_client_info()
1255 strlcpy(client->name, client_info->name, sizeof(client->name)); in snd_seq_ioctl_set_client_info()
1257 client->filter = client_info->filter; in snd_seq_ioctl_set_client_info()
1258 client->event_lost = client_info->event_lost; in snd_seq_ioctl_set_client_info()
1259 memcpy(client->event_filter, client_info->event_filter, 32); in snd_seq_ioctl_set_client_info()
1268 static int snd_seq_ioctl_create_port(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_create_port() argument
1276 if (info->addr.client != client->number) in snd_seq_ioctl_create_port()
1279 …port = snd_seq_create_port(client, (info->flags & SNDRV_SEQ_PORT_FLG_GIVEN_PORT) ? info->addr.port… in snd_seq_ioctl_create_port()
1283 if (client->type == USER_CLIENT && info->kernel) { in snd_seq_ioctl_create_port()
1286 snd_seq_delete_port(client, port_idx); in snd_seq_ioctl_create_port()
1289 if (client->type == KERNEL_CLIENT) { in snd_seq_ioctl_create_port()
1306 snd_seq_system_client_ev_port_start(port->addr.client, port->addr.port); in snd_seq_ioctl_create_port()
1315 static int snd_seq_ioctl_delete_port(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_delete_port() argument
1321 if (info->addr.client != client->number) in snd_seq_ioctl_delete_port()
1324 err = snd_seq_delete_port(client, info->addr.port); in snd_seq_ioctl_delete_port()
1326 snd_seq_system_client_ev_port_exit(client->number, info->addr.port); in snd_seq_ioctl_delete_port()
1334 static int snd_seq_ioctl_get_port_info(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_get_port_info() argument
1340 cptr = snd_seq_client_use_ptr(info->addr.client); in snd_seq_ioctl_get_port_info()
1362 static int snd_seq_ioctl_set_port_info(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_set_port_info() argument
1367 if (info->addr.client != client->number) /* only set our own ports ! */ in snd_seq_ioctl_set_port_info()
1369 port = snd_seq_port_use_ptr(client, info->addr.port); in snd_seq_ioctl_set_port_info()
1384 static int check_subscription_permission(struct snd_seq_client *client, in check_subscription_permission() argument
1389 if (client->number != subs->sender.client && in check_subscription_permission()
1390 client->number != subs->dest.client) { in check_subscription_permission()
1402 if (client->number != subs->sender.client) { in check_subscription_permission()
1407 if (client->number != subs->dest.client) { in check_subscription_permission()
1418 int snd_seq_client_notify_subscription(int client, int port, in snd_seq_client_notify_subscription() argument
1429 return snd_seq_system_notify(client, port, &event); /* non-atomic */ in snd_seq_client_notify_subscription()
1436 static int snd_seq_ioctl_subscribe_port(struct snd_seq_client *client, in snd_seq_ioctl_subscribe_port() argument
1444 if ((receiver = snd_seq_client_use_ptr(subs->dest.client)) == NULL) in snd_seq_ioctl_subscribe_port()
1446 if ((sender = snd_seq_client_use_ptr(subs->sender.client)) == NULL) in snd_seq_ioctl_subscribe_port()
1453 result = check_subscription_permission(client, sport, dport, subs); in snd_seq_ioctl_subscribe_port()
1458 result = snd_seq_port_connect(client, sender, sport, receiver, dport, subs); in snd_seq_ioctl_subscribe_port()
1478 static int snd_seq_ioctl_unsubscribe_port(struct snd_seq_client *client, in snd_seq_ioctl_unsubscribe_port() argument
1486 if ((receiver = snd_seq_client_use_ptr(subs->dest.client)) == NULL) in snd_seq_ioctl_unsubscribe_port()
1488 if ((sender = snd_seq_client_use_ptr(subs->sender.client)) == NULL) in snd_seq_ioctl_unsubscribe_port()
1495 result = check_subscription_permission(client, sport, dport, subs); in snd_seq_ioctl_unsubscribe_port()
1499 result = snd_seq_port_disconnect(client, sender, sport, receiver, dport, subs); in snd_seq_ioctl_unsubscribe_port()
1517 static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_create_queue() argument
1522 q = snd_seq_queue_alloc(client->number, info->locked, info->flags); in snd_seq_ioctl_create_queue()
1540 static int snd_seq_ioctl_delete_queue(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_delete_queue() argument
1544 return snd_seq_queue_delete(client->number, info->queue); in snd_seq_ioctl_delete_queue()
1548 static int snd_seq_ioctl_get_queue_info(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_info() argument
1569 static int snd_seq_ioctl_set_queue_info(struct snd_seq_client *client, in snd_seq_ioctl_set_queue_info() argument
1575 if (info->owner != client->number) in snd_seq_ioctl_set_queue_info()
1579 if (snd_seq_queue_check_access(info->queue, client->number)) { in snd_seq_ioctl_set_queue_info()
1580 if (snd_seq_queue_set_owner(info->queue, client->number, info->locked) < 0) in snd_seq_ioctl_set_queue_info()
1583 snd_seq_queue_use(info->queue, client->number, 1); in snd_seq_ioctl_set_queue_info()
1591 if (q->owner != client->number) { in snd_seq_ioctl_set_queue_info()
1602 static int snd_seq_ioctl_get_named_queue(struct snd_seq_client *client, in snd_seq_ioctl_get_named_queue() argument
1620 static int snd_seq_ioctl_get_queue_status(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_status() argument
1649 static int snd_seq_ioctl_get_queue_tempo(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_tempo() argument
1675 int snd_seq_set_queue_tempo(int client, struct snd_seq_queue_tempo *tempo) in snd_seq_set_queue_tempo() argument
1677 if (!snd_seq_queue_check_access(tempo->queue, client)) in snd_seq_set_queue_tempo()
1679 return snd_seq_queue_timer_set_tempo(tempo->queue, client, tempo); in snd_seq_set_queue_tempo()
1683 static int snd_seq_ioctl_set_queue_tempo(struct snd_seq_client *client, in snd_seq_ioctl_set_queue_tempo() argument
1689 result = snd_seq_set_queue_tempo(client->number, tempo); in snd_seq_ioctl_set_queue_tempo()
1695 static int snd_seq_ioctl_get_queue_timer(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_timer() argument
1724 static int snd_seq_ioctl_set_queue_timer(struct snd_seq_client *client, in snd_seq_ioctl_set_queue_timer() argument
1733 if (snd_seq_queue_check_access(timer->queue, client->number)) { in snd_seq_ioctl_set_queue_timer()
1760 static int snd_seq_ioctl_get_queue_client(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_client() argument
1766 used = snd_seq_queue_is_used(info->queue, client->number); in snd_seq_ioctl_get_queue_client()
1770 info->client = client->number; in snd_seq_ioctl_get_queue_client()
1777 static int snd_seq_ioctl_set_queue_client(struct snd_seq_client *client, in snd_seq_ioctl_set_queue_client() argument
1784 err = snd_seq_queue_use(info->queue, client->number, info->used); in snd_seq_ioctl_set_queue_client()
1789 return snd_seq_ioctl_get_queue_client(client, arg); in snd_seq_ioctl_set_queue_client()
1794 static int snd_seq_ioctl_get_client_pool(struct snd_seq_client *client, in snd_seq_ioctl_get_client_pool() argument
1800 cptr = snd_seq_client_use_ptr(info->client); in snd_seq_ioctl_get_client_pool()
1804 info->client = cptr->number; in snd_seq_ioctl_get_client_pool()
1824 static int snd_seq_ioctl_set_client_pool(struct snd_seq_client *client, in snd_seq_ioctl_set_client_pool() argument
1830 if (client->number != info->client) in snd_seq_ioctl_set_client_pool()
1834 (! snd_seq_write_pool_allocated(client) || in snd_seq_ioctl_set_client_pool()
1835 info->output_pool != client->pool->size)) { in snd_seq_ioctl_set_client_pool()
1836 if (snd_seq_write_pool_allocated(client)) { in snd_seq_ioctl_set_client_pool()
1838 if (atomic_read(&client->pool->counter)) in snd_seq_ioctl_set_client_pool()
1841 snd_seq_pool_mark_closing(client->pool); in snd_seq_ioctl_set_client_pool()
1842 snd_seq_pool_done(client->pool); in snd_seq_ioctl_set_client_pool()
1844 client->pool->size = info->output_pool; in snd_seq_ioctl_set_client_pool()
1845 rc = snd_seq_pool_init(client->pool); in snd_seq_ioctl_set_client_pool()
1849 if (client->type == USER_CLIENT && client->data.user.fifo != NULL && in snd_seq_ioctl_set_client_pool()
1852 info->input_pool != client->data.user.fifo_pool_size) { in snd_seq_ioctl_set_client_pool()
1854 rc = snd_seq_fifo_resize(client->data.user.fifo, info->input_pool); in snd_seq_ioctl_set_client_pool()
1857 client->data.user.fifo_pool_size = info->input_pool; in snd_seq_ioctl_set_client_pool()
1860 info->output_room <= client->pool->size) { in snd_seq_ioctl_set_client_pool()
1861 client->pool->room = info->output_room; in snd_seq_ioctl_set_client_pool()
1864 return snd_seq_ioctl_get_client_pool(client, arg); in snd_seq_ioctl_set_client_pool()
1869 static int snd_seq_ioctl_remove_events(struct snd_seq_client *client, in snd_seq_ioctl_remove_events() argument
1882 if (client->type == USER_CLIENT && client->data.user.fifo) in snd_seq_ioctl_remove_events()
1883 snd_seq_fifo_clear(client->data.user.fifo); in snd_seq_ioctl_remove_events()
1887 snd_seq_queue_remove_cells(client->number, info); in snd_seq_ioctl_remove_events()
1896 static int snd_seq_ioctl_get_subscription(struct snd_seq_client *client, in snd_seq_ioctl_get_subscription() argument
1906 if ((sender = snd_seq_client_use_ptr(subs->sender.client)) == NULL) in snd_seq_ioctl_get_subscription()
1930 static int snd_seq_ioctl_query_subs(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_query_subs() argument
1940 if ((cptr = snd_seq_client_use_ptr(subs->root.client)) == NULL) in snd_seq_ioctl_query_subs()
1993 static int snd_seq_ioctl_query_next_client(struct snd_seq_client *client, in snd_seq_ioctl_query_next_client() argument
2000 if (info->client < INT_MAX) in snd_seq_ioctl_query_next_client()
2001 info->client++; in snd_seq_ioctl_query_next_client()
2002 if (info->client < 0) in snd_seq_ioctl_query_next_client()
2003 info->client = 0; in snd_seq_ioctl_query_next_client()
2004 for (; info->client < SNDRV_SEQ_MAX_CLIENTS; info->client++) { in snd_seq_ioctl_query_next_client()
2005 cptr = snd_seq_client_use_ptr(info->client); in snd_seq_ioctl_query_next_client()
2021 static int snd_seq_ioctl_query_next_port(struct snd_seq_client *client, in snd_seq_ioctl_query_next_port() argument
2028 cptr = snd_seq_client_use_ptr(info->addr.client); in snd_seq_ioctl_query_next_port()
2053 int (*func)(struct snd_seq_client *client, void *arg);
2092 struct snd_seq_client *client = file->private_data; in snd_seq_ioctl() local
2115 if (snd_BUG_ON(!client)) in snd_seq_ioctl()
2137 mutex_lock(&client->ioctl_mutex); in snd_seq_ioctl()
2138 err = handler->func(client, &buf); in snd_seq_ioctl()
2139 mutex_unlock(&client->ioctl_mutex); in snd_seq_ioctl()
2165 struct snd_seq_client *client; in snd_seq_create_kernel_client() local
2186 client = seq_create_client1(client_index, 0); in snd_seq_create_kernel_client()
2187 if (client == NULL) { in snd_seq_create_kernel_client()
2193 client->accept_input = 1; in snd_seq_create_kernel_client()
2194 client->accept_output = 1; in snd_seq_create_kernel_client()
2195 client->data.kernel.card = card; in snd_seq_create_kernel_client()
2198 vsnprintf(client->name, sizeof(client->name), name_fmt, args); in snd_seq_create_kernel_client()
2201 client->type = KERNEL_CLIENT; in snd_seq_create_kernel_client()
2205 snd_seq_system_client_ev_client_start(client->number); in snd_seq_create_kernel_client()
2208 return client->number; in snd_seq_create_kernel_client()
2213 int snd_seq_delete_kernel_client(int client) in snd_seq_delete_kernel_client() argument
2220 ptr = clientptr(client); in snd_seq_delete_kernel_client()
2233 static int kernel_client_enqueue(int client, struct snd_seq_event *ev, in kernel_client_enqueue() argument
2249 ev->source.client = client; in kernel_client_enqueue()
2254 cptr = snd_seq_client_use_ptr(client); in kernel_client_enqueue()
2273 int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event * ev, in snd_seq_kernel_client_enqueue() argument
2276 return kernel_client_enqueue(client, ev, NULL, 0, atomic, hop); in snd_seq_kernel_client_enqueue()
2285 int snd_seq_kernel_client_enqueue_blocking(int client, struct snd_seq_event * ev, in snd_seq_kernel_client_enqueue_blocking() argument
2289 return kernel_client_enqueue(client, ev, file, 1, atomic, hop); in snd_seq_kernel_client_enqueue_blocking()
2300 int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event * ev, in snd_seq_kernel_client_dispatch() argument
2311 ev->source.client = client; in snd_seq_kernel_client_dispatch()
2316 cptr = snd_seq_client_use_ptr(client); in snd_seq_kernel_client_dispatch()
2345 struct snd_seq_client *client; in snd_seq_kernel_client_ctl() local
2347 client = clientptr(clientid); in snd_seq_kernel_client_ctl()
2348 if (client == NULL) in snd_seq_kernel_client_ctl()
2353 return handler->func(client, arg); in snd_seq_kernel_client_ctl()
2365 struct snd_seq_client *client; in snd_seq_kernel_client_write_poll() local
2367 client = clientptr(clientid); in snd_seq_kernel_client_write_poll()
2368 if (client == NULL) in snd_seq_kernel_client_write_poll()
2371 if (! snd_seq_write_pool_allocated(client)) in snd_seq_kernel_client_write_poll()
2373 if (snd_seq_pool_poll_wait(client->pool, file, wait)) in snd_seq_kernel_client_write_poll()
2407 is_src ? s->info.dest.client : s->info.sender.client, in snd_seq_info_dump_subscribers()
2425 struct snd_seq_client *client) in snd_seq_info_dump_ports() argument
2429 mutex_lock(&client->ports_mutex); in snd_seq_info_dump_ports()
2430 list_for_each_entry(p, &client->ports_list_head, list) { in snd_seq_info_dump_ports()
2440 mutex_unlock(&client->ports_mutex); in snd_seq_info_dump_ports()
2449 struct snd_seq_client *client; in snd_seq_info_clients_read() local
2459 client = snd_seq_client_use_ptr(c); in snd_seq_info_clients_read()
2460 if (client == NULL) in snd_seq_info_clients_read()
2462 if (client->type == NO_CLIENT) { in snd_seq_info_clients_read()
2463 snd_seq_client_unlock(client); in snd_seq_info_clients_read()
2468 c, client->name, in snd_seq_info_clients_read()
2469 client->type == USER_CLIENT ? "User" : "Kernel"); in snd_seq_info_clients_read()
2470 snd_seq_info_dump_ports(buffer, client); in snd_seq_info_clients_read()
2471 if (snd_seq_write_pool_allocated(client)) { in snd_seq_info_clients_read()
2473 snd_seq_info_pool(buffer, client->pool, " "); in snd_seq_info_clients_read()
2475 if (client->type == USER_CLIENT && client->data.user.fifo && in snd_seq_info_clients_read()
2476 client->data.user.fifo->pool) { in snd_seq_info_clients_read()
2478 snd_seq_info_pool(buffer, client->data.user.fifo->pool, " "); in snd_seq_info_clients_read()
2480 snd_seq_client_unlock(client); in snd_seq_info_clients_read()