Lines Matching refs:client
66 static int bounce_error_event(struct snd_seq_client *client,
69 static int snd_seq_deliver_single_event(struct snd_seq_client *client,
87 static inline int snd_seq_write_pool_allocated(struct snd_seq_client *client) in snd_seq_write_pool_allocated() argument
89 return snd_seq_total_cells(client->pool) > 0; in snd_seq_write_pool_allocated()
106 struct snd_seq_client *client; in snd_seq_client_use_ptr() local
114 client = clientptr(clientid); in snd_seq_client_use_ptr()
115 if (client) in snd_seq_client_use_ptr()
151 client = clientptr(clientid); in snd_seq_client_use_ptr()
152 if (client) in snd_seq_client_use_ptr()
160 snd_use_lock_use(&client->use_lock); in snd_seq_client_use_ptr()
162 return client; in snd_seq_client_use_ptr()
171 struct snd_seq_client *client; in snd_seq_client_ioctl_lock() local
173 client = snd_seq_client_use_ptr(clientid); in snd_seq_client_ioctl_lock()
174 if (!client) in snd_seq_client_ioctl_lock()
176 mutex_lock(&client->ioctl_mutex); in snd_seq_client_ioctl_lock()
185 struct snd_seq_client *client; in snd_seq_client_ioctl_unlock() local
187 client = snd_seq_client_use_ptr(clientid); in snd_seq_client_ioctl_unlock()
188 if (WARN_ON(!client)) in snd_seq_client_ioctl_unlock()
190 mutex_unlock(&client->ioctl_mutex); in snd_seq_client_ioctl_unlock()
195 snd_seq_client_unlock(client); in snd_seq_client_ioctl_unlock()
196 snd_seq_client_unlock(client); in snd_seq_client_ioctl_unlock()
225 struct snd_seq_client *client; in seq_create_client1() local
228 client = kzalloc(sizeof(*client), GFP_KERNEL); in seq_create_client1()
229 if (client == NULL) in seq_create_client1()
231 client->pool = snd_seq_pool_new(poolsize); in seq_create_client1()
232 if (client->pool == NULL) { in seq_create_client1()
233 kfree(client); in seq_create_client1()
236 client->type = NO_CLIENT; in seq_create_client1()
237 snd_use_lock_init(&client->use_lock); in seq_create_client1()
238 rwlock_init(&client->ports_lock); in seq_create_client1()
239 mutex_init(&client->ports_mutex); in seq_create_client1()
240 INIT_LIST_HEAD(&client->ports_list_head); in seq_create_client1()
241 mutex_init(&client->ioctl_mutex); in seq_create_client1()
251 clienttab[client->number = c] = client; in seq_create_client1()
253 return client; in seq_create_client1()
257 clienttab[client->number = client_index] = client; in seq_create_client1()
259 return client; in seq_create_client1()
263 snd_seq_pool_delete(&client->pool); in seq_create_client1()
264 kfree(client); in seq_create_client1()
269 static int seq_free_client1(struct snd_seq_client *client) in seq_free_client1() argument
271 if (!client) in seq_free_client1()
274 clienttablock[client->number] = 1; in seq_free_client1()
275 clienttab[client->number] = NULL; in seq_free_client1()
277 snd_seq_delete_all_ports(client); in seq_free_client1()
278 snd_seq_queue_client_leave(client->number); in seq_free_client1()
279 snd_use_lock_sync(&client->use_lock); in seq_free_client1()
280 if (client->pool) in seq_free_client1()
281 snd_seq_pool_delete(&client->pool); in seq_free_client1()
283 clienttablock[client->number] = 0; in seq_free_client1()
289 static void seq_free_client(struct snd_seq_client * client) in seq_free_client() argument
292 switch (client->type) { in seq_free_client()
295 client->number); in seq_free_client()
299 seq_free_client1(client); in seq_free_client()
305 client->number, client->type); in seq_free_client()
309 snd_seq_system_client_ev_client_exit(client->number); in seq_free_client()
320 struct snd_seq_client *client; in snd_seq_open() local
329 client = seq_create_client1(-1, SNDRV_SEQ_DEFAULT_EVENTS); in snd_seq_open()
330 if (!client) { in snd_seq_open()
337 client->accept_input = 1; in snd_seq_open()
339 client->accept_output = 1; in snd_seq_open()
341 user = &client->data.user; in snd_seq_open()
349 seq_free_client1(client); in snd_seq_open()
350 kfree(client); in snd_seq_open()
357 client->type = USER_CLIENT; in snd_seq_open()
360 c = client->number; in snd_seq_open()
361 file->private_data = client; in snd_seq_open()
365 sprintf(client->name, "Client-%d", c); in snd_seq_open()
366 client->data.user.owner = get_pid(task_pid(current)); in snd_seq_open()
377 struct snd_seq_client *client = file->private_data; in snd_seq_release() local
379 if (client) { in snd_seq_release()
380 seq_free_client(client); in snd_seq_release()
381 if (client->data.user.fifo) in snd_seq_release()
382 snd_seq_fifo_delete(&client->data.user.fifo); in snd_seq_release()
383 put_pid(client->data.user.owner); in snd_seq_release()
384 kfree(client); in snd_seq_release()
401 struct snd_seq_client *client = file->private_data; in snd_seq_read() local
414 if (snd_BUG_ON(!client)) in snd_seq_read()
417 if (!client->accept_input) in snd_seq_read()
419 fifo = client->data.user.fifo; in snd_seq_read()
504 dest = snd_seq_client_use_ptr(event->dest.client); in get_event_dest_client()
533 static int bounce_error_event(struct snd_seq_client *client, in bounce_error_event() argument
540 if (client == NULL || in bounce_error_event()
541 ! (client->filter & SNDRV_SEQ_FILTER_BOUNCE) || in bounce_error_event()
542 ! client->accept_input) in bounce_error_event()
550 bounce_ev.source.client = SNDRV_SEQ_CLIENT_SYSTEM; in bounce_error_event()
552 bounce_ev.dest.client = client->number; in bounce_error_event()
559 client->event_lost++; in bounce_error_event()
601 static int snd_seq_deliver_single_event(struct snd_seq_client *client, in snd_seq_deliver_single_event() argument
653 result = bounce_error_event(client, event, result, atomic, hop); in snd_seq_deliver_single_event()
662 static int deliver_to_subscribers(struct snd_seq_client *client, in deliver_to_subscribers() argument
672 src_port = snd_seq_port_use_ptr(client, event->source.port); in deliver_to_subscribers()
693 err = snd_seq_deliver_single_event(client, event, in deliver_to_subscribers()
719 static int port_broadcast_event(struct snd_seq_client *client, in port_broadcast_event() argument
756 static int broadcast_event(struct snd_seq_client *client, in broadcast_event() argument
767 if (dest == client->number) in broadcast_event()
769 event->dest.client = dest; in broadcast_event()
772 err = port_broadcast_event(client, event, atomic, hop); in broadcast_event()
792 static int multicast_event(struct snd_seq_client *client, struct snd_seq_event *event, in multicast_event() argument
809 static int snd_seq_deliver_event(struct snd_seq_client *client, struct snd_seq_event *event, in snd_seq_deliver_event() argument
817 event->source.client, event->source.port, in snd_seq_deliver_event()
818 event->dest.client, event->dest.port); in snd_seq_deliver_event()
827 event->dest.client == SNDRV_SEQ_ADDRESS_SUBSCRIBERS) in snd_seq_deliver_event()
828 result = deliver_to_subscribers(client, event, atomic, hop); in snd_seq_deliver_event()
831 event->dest.client == SNDRV_SEQ_ADDRESS_BROADCAST) in snd_seq_deliver_event()
832 result = broadcast_event(client, event, atomic, hop); in snd_seq_deliver_event()
833 else if (event->dest.client >= SNDRV_SEQ_MAX_CLIENTS) in snd_seq_deliver_event()
834 result = multicast_event(client, event, atomic, hop); in snd_seq_deliver_event()
836 result = port_broadcast_event(client, event, atomic, hop); in snd_seq_deliver_event()
839 result = snd_seq_deliver_single_event(client, event, 0, atomic, hop); in snd_seq_deliver_event()
856 struct snd_seq_client *client; in snd_seq_dispatch_event() local
862 client = snd_seq_client_use_ptr(cell->event.source.client); in snd_seq_dispatch_event()
863 if (client == NULL) { in snd_seq_dispatch_event()
878 result = snd_seq_deliver_event(client, &tmpev, atomic, hop); in snd_seq_dispatch_event()
913 result = snd_seq_deliver_event(client, &cell->event, atomic, hop); in snd_seq_dispatch_event()
917 snd_seq_client_unlock(client); in snd_seq_dispatch_event()
926 static int snd_seq_client_enqueue_event(struct snd_seq_client *client, in snd_seq_client_enqueue_event() argument
937 event->dest.client = SNDRV_SEQ_ADDRESS_SUBSCRIBERS; in snd_seq_client_enqueue_event()
942 event->dest.client = SNDRV_SEQ_ADDRESS_BROADCAST; in snd_seq_client_enqueue_event()
946 if (event->dest.client == SNDRV_SEQ_ADDRESS_SUBSCRIBERS) { in snd_seq_client_enqueue_event()
948 struct snd_seq_client_port *src_port = snd_seq_port_use_ptr(client, event->source.port); in snd_seq_client_enqueue_event()
958 return snd_seq_deliver_event(client, event, atomic, hop); in snd_seq_client_enqueue_event()
962 if (snd_seq_queue_is_used(event->queue, client->number) <= 0) in snd_seq_client_enqueue_event()
964 if (! snd_seq_write_pool_allocated(client)) in snd_seq_client_enqueue_event()
968 err = snd_seq_event_dup(client->pool, event, &cell, !blocking || atomic, in snd_seq_client_enqueue_event()
1023 struct snd_seq_client *client = file->private_data; in snd_seq_write() local
1032 if (snd_BUG_ON(!client)) in snd_seq_write()
1035 if (!client->accept_output || client->pool == NULL) in snd_seq_write()
1041 mutex_lock(&client->ioctl_mutex); in snd_seq_write()
1042 if (client->pool->size > 0 && !snd_seq_write_pool_allocated(client)) { in snd_seq_write()
1043 err = snd_seq_pool_init(client->pool); in snd_seq_write()
1057 event.source.client = client->number; /* fill in client number */ in snd_seq_write()
1086 if (client->convert32 && snd_seq_ev_is_varusr(&event)) { in snd_seq_write()
1094 err = snd_seq_client_enqueue_event(client, &event, file, in snd_seq_write()
1096 0, 0, &client->ioctl_mutex); in snd_seq_write()
1109 mutex_unlock(&client->ioctl_mutex); in snd_seq_write()
1115 mutex_unlock(&client->ioctl_mutex); in snd_seq_write()
1125 struct snd_seq_client *client = file->private_data; in snd_seq_poll() local
1129 if (snd_BUG_ON(!client)) in snd_seq_poll()
1133 client->data.user.fifo) { in snd_seq_poll()
1136 if (snd_seq_fifo_poll_wait(client->data.user.fifo, file, wait)) in snd_seq_poll()
1143 if (!snd_seq_write_pool_allocated(client) || in snd_seq_poll()
1144 snd_seq_pool_poll_wait(client->pool, file, wait)) in snd_seq_poll()
1154 static int snd_seq_ioctl_pversion(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_pversion() argument
1162 static int snd_seq_ioctl_client_id(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_client_id() argument
1166 *client_id = client->number; in snd_seq_ioctl_client_id()
1171 static int snd_seq_ioctl_system_info(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_system_info() argument
1189 static int snd_seq_ioctl_running_mode(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_running_mode() argument
1196 cptr = snd_seq_client_use_ptr(info->client); in snd_seq_ioctl_running_mode()
1226 info->client = cptr->number; in get_client_info()
1249 static int snd_seq_ioctl_get_client_info(struct snd_seq_client *client, in snd_seq_ioctl_get_client_info() argument
1256 cptr = snd_seq_client_use_ptr(client_info->client); in snd_seq_ioctl_get_client_info()
1268 static int snd_seq_ioctl_set_client_info(struct snd_seq_client *client, in snd_seq_ioctl_set_client_info() argument
1274 if (client->number != client_info->client) in snd_seq_ioctl_set_client_info()
1277 if (client->type != client_info->type) in snd_seq_ioctl_set_client_info()
1282 strscpy(client->name, client_info->name, sizeof(client->name)); in snd_seq_ioctl_set_client_info()
1284 client->filter = client_info->filter; in snd_seq_ioctl_set_client_info()
1285 client->event_lost = client_info->event_lost; in snd_seq_ioctl_set_client_info()
1286 memcpy(client->event_filter, client_info->event_filter, 32); in snd_seq_ioctl_set_client_info()
1295 static int snd_seq_ioctl_create_port(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_create_port() argument
1303 if (info->addr.client != client->number) in snd_seq_ioctl_create_port()
1306 …port = snd_seq_create_port(client, (info->flags & SNDRV_SEQ_PORT_FLG_GIVEN_PORT) ? info->addr.port… in snd_seq_ioctl_create_port()
1310 if (client->type == USER_CLIENT && info->kernel) { in snd_seq_ioctl_create_port()
1313 snd_seq_delete_port(client, port_idx); in snd_seq_ioctl_create_port()
1316 if (client->type == KERNEL_CLIENT) { in snd_seq_ioctl_create_port()
1334 snd_seq_system_client_ev_port_start(port->addr.client, port->addr.port); in snd_seq_ioctl_create_port()
1343 static int snd_seq_ioctl_delete_port(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_delete_port() argument
1349 if (info->addr.client != client->number) in snd_seq_ioctl_delete_port()
1352 err = snd_seq_delete_port(client, info->addr.port); in snd_seq_ioctl_delete_port()
1354 snd_seq_system_client_ev_port_exit(client->number, info->addr.port); in snd_seq_ioctl_delete_port()
1362 static int snd_seq_ioctl_get_port_info(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_get_port_info() argument
1368 cptr = snd_seq_client_use_ptr(info->addr.client); in snd_seq_ioctl_get_port_info()
1390 static int snd_seq_ioctl_set_port_info(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_set_port_info() argument
1395 if (info->addr.client != client->number) /* only set our own ports ! */ in snd_seq_ioctl_set_port_info()
1397 port = snd_seq_port_use_ptr(client, info->addr.port); in snd_seq_ioctl_set_port_info()
1412 static int check_subscription_permission(struct snd_seq_client *client, in check_subscription_permission() argument
1417 if (client->number != subs->sender.client && in check_subscription_permission()
1418 client->number != subs->dest.client) { in check_subscription_permission()
1430 if (client->number != subs->sender.client) { in check_subscription_permission()
1435 if (client->number != subs->dest.client) { in check_subscription_permission()
1446 int snd_seq_client_notify_subscription(int client, int port, in snd_seq_client_notify_subscription() argument
1457 return snd_seq_system_notify(client, port, &event); /* non-atomic */ in snd_seq_client_notify_subscription()
1464 static int snd_seq_ioctl_subscribe_port(struct snd_seq_client *client, in snd_seq_ioctl_subscribe_port() argument
1472 receiver = snd_seq_client_use_ptr(subs->dest.client); in snd_seq_ioctl_subscribe_port()
1475 sender = snd_seq_client_use_ptr(subs->sender.client); in snd_seq_ioctl_subscribe_port()
1485 result = check_subscription_permission(client, sport, dport, subs); in snd_seq_ioctl_subscribe_port()
1490 result = snd_seq_port_connect(client, sender, sport, receiver, dport, subs); in snd_seq_ioctl_subscribe_port()
1510 static int snd_seq_ioctl_unsubscribe_port(struct snd_seq_client *client, in snd_seq_ioctl_unsubscribe_port() argument
1518 receiver = snd_seq_client_use_ptr(subs->dest.client); in snd_seq_ioctl_unsubscribe_port()
1521 sender = snd_seq_client_use_ptr(subs->sender.client); in snd_seq_ioctl_unsubscribe_port()
1531 result = check_subscription_permission(client, sport, dport, subs); in snd_seq_ioctl_unsubscribe_port()
1535 result = snd_seq_port_disconnect(client, sender, sport, receiver, dport, subs); in snd_seq_ioctl_unsubscribe_port()
1553 static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_create_queue() argument
1558 q = snd_seq_queue_alloc(client->number, info->locked, info->flags); in snd_seq_ioctl_create_queue()
1576 static int snd_seq_ioctl_delete_queue(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_delete_queue() argument
1580 return snd_seq_queue_delete(client->number, info->queue); in snd_seq_ioctl_delete_queue()
1584 static int snd_seq_ioctl_get_queue_info(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_info() argument
1605 static int snd_seq_ioctl_set_queue_info(struct snd_seq_client *client, in snd_seq_ioctl_set_queue_info() argument
1611 if (info->owner != client->number) in snd_seq_ioctl_set_queue_info()
1615 if (snd_seq_queue_check_access(info->queue, client->number)) { in snd_seq_ioctl_set_queue_info()
1616 if (snd_seq_queue_set_owner(info->queue, client->number, info->locked) < 0) in snd_seq_ioctl_set_queue_info()
1619 snd_seq_queue_use(info->queue, client->number, 1); in snd_seq_ioctl_set_queue_info()
1627 if (q->owner != client->number) { in snd_seq_ioctl_set_queue_info()
1638 static int snd_seq_ioctl_get_named_queue(struct snd_seq_client *client, in snd_seq_ioctl_get_named_queue() argument
1656 static int snd_seq_ioctl_get_queue_status(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_status() argument
1685 static int snd_seq_ioctl_get_queue_tempo(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_tempo() argument
1711 int snd_seq_set_queue_tempo(int client, struct snd_seq_queue_tempo *tempo) in snd_seq_set_queue_tempo() argument
1713 if (!snd_seq_queue_check_access(tempo->queue, client)) in snd_seq_set_queue_tempo()
1715 return snd_seq_queue_timer_set_tempo(tempo->queue, client, tempo); in snd_seq_set_queue_tempo()
1719 static int snd_seq_ioctl_set_queue_tempo(struct snd_seq_client *client, in snd_seq_ioctl_set_queue_tempo() argument
1725 result = snd_seq_set_queue_tempo(client->number, tempo); in snd_seq_ioctl_set_queue_tempo()
1731 static int snd_seq_ioctl_get_queue_timer(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_timer() argument
1760 static int snd_seq_ioctl_set_queue_timer(struct snd_seq_client *client, in snd_seq_ioctl_set_queue_timer() argument
1769 if (snd_seq_queue_check_access(timer->queue, client->number)) { in snd_seq_ioctl_set_queue_timer()
1796 static int snd_seq_ioctl_get_queue_client(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_client() argument
1802 used = snd_seq_queue_is_used(info->queue, client->number); in snd_seq_ioctl_get_queue_client()
1806 info->client = client->number; in snd_seq_ioctl_get_queue_client()
1813 static int snd_seq_ioctl_set_queue_client(struct snd_seq_client *client, in snd_seq_ioctl_set_queue_client() argument
1820 err = snd_seq_queue_use(info->queue, client->number, info->used); in snd_seq_ioctl_set_queue_client()
1825 return snd_seq_ioctl_get_queue_client(client, arg); in snd_seq_ioctl_set_queue_client()
1830 static int snd_seq_ioctl_get_client_pool(struct snd_seq_client *client, in snd_seq_ioctl_get_client_pool() argument
1836 cptr = snd_seq_client_use_ptr(info->client); in snd_seq_ioctl_get_client_pool()
1840 info->client = cptr->number; in snd_seq_ioctl_get_client_pool()
1859 static int snd_seq_ioctl_set_client_pool(struct snd_seq_client *client, in snd_seq_ioctl_set_client_pool() argument
1865 if (client->number != info->client) in snd_seq_ioctl_set_client_pool()
1869 (! snd_seq_write_pool_allocated(client) || in snd_seq_ioctl_set_client_pool()
1870 info->output_pool != client->pool->size)) { in snd_seq_ioctl_set_client_pool()
1871 if (snd_seq_write_pool_allocated(client)) { in snd_seq_ioctl_set_client_pool()
1873 if (atomic_read(&client->pool->counter)) in snd_seq_ioctl_set_client_pool()
1876 snd_seq_pool_mark_closing(client->pool); in snd_seq_ioctl_set_client_pool()
1877 snd_seq_pool_done(client->pool); in snd_seq_ioctl_set_client_pool()
1879 client->pool->size = info->output_pool; in snd_seq_ioctl_set_client_pool()
1880 rc = snd_seq_pool_init(client->pool); in snd_seq_ioctl_set_client_pool()
1884 if (client->type == USER_CLIENT && client->data.user.fifo != NULL && in snd_seq_ioctl_set_client_pool()
1887 info->input_pool != client->data.user.fifo_pool_size) { in snd_seq_ioctl_set_client_pool()
1889 rc = snd_seq_fifo_resize(client->data.user.fifo, info->input_pool); in snd_seq_ioctl_set_client_pool()
1892 client->data.user.fifo_pool_size = info->input_pool; in snd_seq_ioctl_set_client_pool()
1895 info->output_room <= client->pool->size) { in snd_seq_ioctl_set_client_pool()
1896 client->pool->room = info->output_room; in snd_seq_ioctl_set_client_pool()
1899 return snd_seq_ioctl_get_client_pool(client, arg); in snd_seq_ioctl_set_client_pool()
1904 static int snd_seq_ioctl_remove_events(struct snd_seq_client *client, in snd_seq_ioctl_remove_events() argument
1917 if (client->type == USER_CLIENT && client->data.user.fifo) in snd_seq_ioctl_remove_events()
1918 snd_seq_fifo_clear(client->data.user.fifo); in snd_seq_ioctl_remove_events()
1922 snd_seq_queue_remove_cells(client->number, info); in snd_seq_ioctl_remove_events()
1931 static int snd_seq_ioctl_get_subscription(struct snd_seq_client *client, in snd_seq_ioctl_get_subscription() argument
1940 sender = snd_seq_client_use_ptr(subs->sender.client); in snd_seq_ioctl_get_subscription()
1961 static int snd_seq_ioctl_query_subs(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_query_subs() argument
1971 cptr = snd_seq_client_use_ptr(subs->root.client); in snd_seq_ioctl_query_subs()
2026 static int snd_seq_ioctl_query_next_client(struct snd_seq_client *client, in snd_seq_ioctl_query_next_client() argument
2033 if (info->client < INT_MAX) in snd_seq_ioctl_query_next_client()
2034 info->client++; in snd_seq_ioctl_query_next_client()
2035 if (info->client < 0) in snd_seq_ioctl_query_next_client()
2036 info->client = 0; in snd_seq_ioctl_query_next_client()
2037 for (; info->client < SNDRV_SEQ_MAX_CLIENTS; info->client++) { in snd_seq_ioctl_query_next_client()
2038 cptr = snd_seq_client_use_ptr(info->client); in snd_seq_ioctl_query_next_client()
2054 static int snd_seq_ioctl_query_next_port(struct snd_seq_client *client, in snd_seq_ioctl_query_next_port() argument
2061 cptr = snd_seq_client_use_ptr(info->addr.client); in snd_seq_ioctl_query_next_port()
2086 int (*func)(struct snd_seq_client *client, void *arg);
2125 struct snd_seq_client *client = file->private_data; in snd_seq_ioctl() local
2148 if (snd_BUG_ON(!client)) in snd_seq_ioctl()
2170 mutex_lock(&client->ioctl_mutex); in snd_seq_ioctl()
2171 err = handler->func(client, &buf); in snd_seq_ioctl()
2172 mutex_unlock(&client->ioctl_mutex); in snd_seq_ioctl()
2198 struct snd_seq_client *client; in snd_seq_create_kernel_client() local
2219 client = seq_create_client1(client_index, 0); in snd_seq_create_kernel_client()
2220 if (client == NULL) { in snd_seq_create_kernel_client()
2226 client->accept_input = 1; in snd_seq_create_kernel_client()
2227 client->accept_output = 1; in snd_seq_create_kernel_client()
2228 client->data.kernel.card = card; in snd_seq_create_kernel_client()
2231 vsnprintf(client->name, sizeof(client->name), name_fmt, args); in snd_seq_create_kernel_client()
2234 client->type = KERNEL_CLIENT; in snd_seq_create_kernel_client()
2238 snd_seq_system_client_ev_client_start(client->number); in snd_seq_create_kernel_client()
2241 return client->number; in snd_seq_create_kernel_client()
2246 int snd_seq_delete_kernel_client(int client) in snd_seq_delete_kernel_client() argument
2253 ptr = clientptr(client); in snd_seq_delete_kernel_client()
2268 int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, in snd_seq_kernel_client_enqueue() argument
2283 ev->source.client = client; in snd_seq_kernel_client_enqueue()
2288 cptr = snd_seq_client_use_ptr(client); in snd_seq_kernel_client_enqueue()
2314 int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event * ev, in snd_seq_kernel_client_dispatch() argument
2325 ev->source.client = client; in snd_seq_kernel_client_dispatch()
2330 cptr = snd_seq_client_use_ptr(client); in snd_seq_kernel_client_dispatch()
2359 struct snd_seq_client *client; in snd_seq_kernel_client_ctl() local
2361 client = clientptr(clientid); in snd_seq_kernel_client_ctl()
2362 if (client == NULL) in snd_seq_kernel_client_ctl()
2367 return handler->func(client, arg); in snd_seq_kernel_client_ctl()
2379 struct snd_seq_client *client; in snd_seq_kernel_client_write_poll() local
2381 client = clientptr(clientid); in snd_seq_kernel_client_write_poll()
2382 if (client == NULL) in snd_seq_kernel_client_write_poll()
2385 if (! snd_seq_write_pool_allocated(client)) in snd_seq_kernel_client_write_poll()
2387 if (snd_seq_pool_poll_wait(client->pool, file, wait)) in snd_seq_kernel_client_write_poll()
2421 is_src ? s->info.dest.client : s->info.sender.client, in snd_seq_info_dump_subscribers()
2439 struct snd_seq_client *client) in snd_seq_info_dump_ports() argument
2443 mutex_lock(&client->ports_mutex); in snd_seq_info_dump_ports()
2444 list_for_each_entry(p, &client->ports_list_head, list) { in snd_seq_info_dump_ports()
2454 mutex_unlock(&client->ports_mutex); in snd_seq_info_dump_ports()
2463 struct snd_seq_client *client; in snd_seq_info_clients_read() local
2473 client = snd_seq_client_use_ptr(c); in snd_seq_info_clients_read()
2474 if (client == NULL) in snd_seq_info_clients_read()
2476 if (client->type == NO_CLIENT) { in snd_seq_info_clients_read()
2477 snd_seq_client_unlock(client); in snd_seq_info_clients_read()
2482 c, client->name, in snd_seq_info_clients_read()
2483 client->type == USER_CLIENT ? "User" : "Kernel"); in snd_seq_info_clients_read()
2484 snd_seq_info_dump_ports(buffer, client); in snd_seq_info_clients_read()
2485 if (snd_seq_write_pool_allocated(client)) { in snd_seq_info_clients_read()
2487 snd_seq_info_pool(buffer, client->pool, " "); in snd_seq_info_clients_read()
2489 if (client->type == USER_CLIENT && client->data.user.fifo && in snd_seq_info_clients_read()
2490 client->data.user.fifo->pool) { in snd_seq_info_clients_read()
2492 snd_seq_info_pool(buffer, client->data.user.fifo->pool, " "); in snd_seq_info_clients_read()
2494 snd_seq_client_unlock(client); in snd_seq_info_clients_read()