• Home
  • Raw
  • Download

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()
153 client = clientptr(clientid); in snd_seq_client_use_ptr()
154 if (client) in snd_seq_client_use_ptr()
162 snd_use_lock_use(&client->use_lock); in snd_seq_client_use_ptr()
164 return client; in snd_seq_client_use_ptr()
173 struct snd_seq_client *client; in snd_seq_client_ioctl_lock() local
175 client = snd_seq_client_use_ptr(clientid); in snd_seq_client_ioctl_lock()
176 if (!client) in snd_seq_client_ioctl_lock()
178 mutex_lock(&client->ioctl_mutex); in snd_seq_client_ioctl_lock()
187 struct snd_seq_client *client; in snd_seq_client_ioctl_unlock() local
189 client = snd_seq_client_use_ptr(clientid); in snd_seq_client_ioctl_unlock()
190 if (WARN_ON(!client)) in snd_seq_client_ioctl_unlock()
192 mutex_unlock(&client->ioctl_mutex); in snd_seq_client_ioctl_unlock()
197 snd_seq_client_unlock(client); in snd_seq_client_ioctl_unlock()
198 snd_seq_client_unlock(client); in snd_seq_client_ioctl_unlock()
227 struct snd_seq_client *client; in seq_create_client1() local
230 client = kzalloc(sizeof(*client), GFP_KERNEL); in seq_create_client1()
231 if (client == NULL) in seq_create_client1()
233 client->pool = snd_seq_pool_new(poolsize); in seq_create_client1()
234 if (client->pool == NULL) { in seq_create_client1()
235 kfree(client); in seq_create_client1()
238 client->type = NO_CLIENT; in seq_create_client1()
239 snd_use_lock_init(&client->use_lock); in seq_create_client1()
240 rwlock_init(&client->ports_lock); in seq_create_client1()
241 mutex_init(&client->ports_mutex); in seq_create_client1()
242 INIT_LIST_HEAD(&client->ports_list_head); in seq_create_client1()
243 mutex_init(&client->ioctl_mutex); in seq_create_client1()
253 clienttab[client->number = c] = client; in seq_create_client1()
255 return client; in seq_create_client1()
259 clienttab[client->number = client_index] = client; in seq_create_client1()
261 return client; in seq_create_client1()
265 snd_seq_pool_delete(&client->pool); in seq_create_client1()
266 kfree(client); in seq_create_client1()
271 static int seq_free_client1(struct snd_seq_client *client) in seq_free_client1() argument
273 if (!client) in seq_free_client1()
276 clienttablock[client->number] = 1; in seq_free_client1()
277 clienttab[client->number] = NULL; in seq_free_client1()
279 snd_seq_delete_all_ports(client); in seq_free_client1()
280 snd_seq_queue_client_leave(client->number); in seq_free_client1()
281 snd_use_lock_sync(&client->use_lock); in seq_free_client1()
282 snd_seq_queue_client_termination(client->number); in seq_free_client1()
283 if (client->pool) in seq_free_client1()
284 snd_seq_pool_delete(&client->pool); in seq_free_client1()
286 clienttablock[client->number] = 0; in seq_free_client1()
292 static void seq_free_client(struct snd_seq_client * client) in seq_free_client() argument
295 switch (client->type) { in seq_free_client()
298 client->number); in seq_free_client()
302 seq_free_client1(client); in seq_free_client()
308 client->number, client->type); in seq_free_client()
312 snd_seq_system_client_ev_client_exit(client->number); in seq_free_client()
323 struct snd_seq_client *client; in snd_seq_open() local
332 client = seq_create_client1(-1, SNDRV_SEQ_DEFAULT_EVENTS); in snd_seq_open()
333 if (!client) { in snd_seq_open()
340 client->accept_input = 1; in snd_seq_open()
342 client->accept_output = 1; in snd_seq_open()
344 user = &client->data.user; in snd_seq_open()
352 seq_free_client1(client); in snd_seq_open()
353 kfree(client); in snd_seq_open()
360 client->type = USER_CLIENT; in snd_seq_open()
363 c = client->number; in snd_seq_open()
364 file->private_data = client; in snd_seq_open()
368 sprintf(client->name, "Client-%d", c); in snd_seq_open()
369 client->data.user.owner = get_pid(task_pid(current)); in snd_seq_open()
380 struct snd_seq_client *client = file->private_data; in snd_seq_release() local
382 if (client) { in snd_seq_release()
383 seq_free_client(client); in snd_seq_release()
384 if (client->data.user.fifo) in snd_seq_release()
385 snd_seq_fifo_delete(&client->data.user.fifo); in snd_seq_release()
386 put_pid(client->data.user.owner); in snd_seq_release()
387 kfree(client); in snd_seq_release()
404 struct snd_seq_client *client = file->private_data; in snd_seq_read() local
417 if (snd_BUG_ON(!client)) in snd_seq_read()
420 if (!client->accept_input || (fifo = client->data.user.fifo) == NULL) 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()
1022 struct snd_seq_client *client = file->private_data; in snd_seq_write() local
1031 if (snd_BUG_ON(!client)) in snd_seq_write()
1034 if (!client->accept_output || client->pool == NULL) in snd_seq_write()
1040 mutex_lock(&client->ioctl_mutex); in snd_seq_write()
1041 if (client->pool->size > 0 && !snd_seq_write_pool_allocated(client)) { in snd_seq_write()
1042 err = snd_seq_pool_init(client->pool); in snd_seq_write()
1056 event.source.client = client->number; /* fill in client number */ in snd_seq_write()
1085 if (client->convert32 && snd_seq_ev_is_varusr(&event)) { in snd_seq_write()
1093 err = snd_seq_client_enqueue_event(client, &event, file, in snd_seq_write()
1095 0, 0, &client->ioctl_mutex); in snd_seq_write()
1108 mutex_unlock(&client->ioctl_mutex); in snd_seq_write()
1114 mutex_unlock(&client->ioctl_mutex); in snd_seq_write()
1124 struct snd_seq_client *client = file->private_data; in snd_seq_poll() local
1128 if (snd_BUG_ON(!client)) in snd_seq_poll()
1132 client->data.user.fifo) { in snd_seq_poll()
1135 if (snd_seq_fifo_poll_wait(client->data.user.fifo, file, wait)) in snd_seq_poll()
1142 if (!snd_seq_write_pool_allocated(client) || in snd_seq_poll()
1143 snd_seq_pool_poll_wait(client->pool, file, wait)) in snd_seq_poll()
1153 static int snd_seq_ioctl_pversion(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_pversion() argument
1161 static int snd_seq_ioctl_client_id(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_client_id() argument
1165 *client_id = client->number; in snd_seq_ioctl_client_id()
1170 static int snd_seq_ioctl_system_info(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_system_info() argument
1188 static int snd_seq_ioctl_running_mode(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_running_mode() argument
1195 cptr = snd_seq_client_use_ptr(info->client); in snd_seq_ioctl_running_mode()
1225 info->client = cptr->number; in get_client_info()
1248 static int snd_seq_ioctl_get_client_info(struct snd_seq_client *client, in snd_seq_ioctl_get_client_info() argument
1255 cptr = snd_seq_client_use_ptr(client_info->client); in snd_seq_ioctl_get_client_info()
1267 static int snd_seq_ioctl_set_client_info(struct snd_seq_client *client, in snd_seq_ioctl_set_client_info() argument
1273 if (client->number != client_info->client) in snd_seq_ioctl_set_client_info()
1276 if (client->type != client_info->type) in snd_seq_ioctl_set_client_info()
1281 strscpy(client->name, client_info->name, sizeof(client->name)); in snd_seq_ioctl_set_client_info()
1283 client->filter = client_info->filter; in snd_seq_ioctl_set_client_info()
1284 client->event_lost = client_info->event_lost; in snd_seq_ioctl_set_client_info()
1285 memcpy(client->event_filter, client_info->event_filter, 32); in snd_seq_ioctl_set_client_info()
1294 static int snd_seq_ioctl_create_port(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_create_port() argument
1302 if (info->addr.client != client->number) in snd_seq_ioctl_create_port()
1305 …port = snd_seq_create_port(client, (info->flags & SNDRV_SEQ_PORT_FLG_GIVEN_PORT) ? info->addr.port… in snd_seq_ioctl_create_port()
1309 if (client->type == USER_CLIENT && info->kernel) { in snd_seq_ioctl_create_port()
1312 snd_seq_delete_port(client, port_idx); in snd_seq_ioctl_create_port()
1315 if (client->type == KERNEL_CLIENT) { in snd_seq_ioctl_create_port()
1332 snd_seq_system_client_ev_port_start(port->addr.client, port->addr.port); in snd_seq_ioctl_create_port()
1341 static int snd_seq_ioctl_delete_port(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_delete_port() argument
1347 if (info->addr.client != client->number) in snd_seq_ioctl_delete_port()
1350 err = snd_seq_delete_port(client, info->addr.port); in snd_seq_ioctl_delete_port()
1352 snd_seq_system_client_ev_port_exit(client->number, info->addr.port); in snd_seq_ioctl_delete_port()
1360 static int snd_seq_ioctl_get_port_info(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_get_port_info() argument
1366 cptr = snd_seq_client_use_ptr(info->addr.client); in snd_seq_ioctl_get_port_info()
1388 static int snd_seq_ioctl_set_port_info(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_set_port_info() argument
1393 if (info->addr.client != client->number) /* only set our own ports ! */ in snd_seq_ioctl_set_port_info()
1395 port = snd_seq_port_use_ptr(client, info->addr.port); in snd_seq_ioctl_set_port_info()
1410 static int check_subscription_permission(struct snd_seq_client *client, in check_subscription_permission() argument
1415 if (client->number != subs->sender.client && in check_subscription_permission()
1416 client->number != subs->dest.client) { in check_subscription_permission()
1428 if (client->number != subs->sender.client) { in check_subscription_permission()
1433 if (client->number != subs->dest.client) { in check_subscription_permission()
1444 int snd_seq_client_notify_subscription(int client, int port, in snd_seq_client_notify_subscription() argument
1455 return snd_seq_system_notify(client, port, &event); /* non-atomic */ in snd_seq_client_notify_subscription()
1462 static int snd_seq_ioctl_subscribe_port(struct snd_seq_client *client, in snd_seq_ioctl_subscribe_port() argument
1470 if ((receiver = snd_seq_client_use_ptr(subs->dest.client)) == NULL) in snd_seq_ioctl_subscribe_port()
1472 if ((sender = snd_seq_client_use_ptr(subs->sender.client)) == NULL) in snd_seq_ioctl_subscribe_port()
1479 result = check_subscription_permission(client, sport, dport, subs); in snd_seq_ioctl_subscribe_port()
1484 result = snd_seq_port_connect(client, sender, sport, receiver, dport, subs); in snd_seq_ioctl_subscribe_port()
1504 static int snd_seq_ioctl_unsubscribe_port(struct snd_seq_client *client, in snd_seq_ioctl_unsubscribe_port() argument
1512 if ((receiver = snd_seq_client_use_ptr(subs->dest.client)) == NULL) in snd_seq_ioctl_unsubscribe_port()
1514 if ((sender = snd_seq_client_use_ptr(subs->sender.client)) == NULL) in snd_seq_ioctl_unsubscribe_port()
1521 result = check_subscription_permission(client, sport, dport, subs); in snd_seq_ioctl_unsubscribe_port()
1525 result = snd_seq_port_disconnect(client, sender, sport, receiver, dport, subs); in snd_seq_ioctl_unsubscribe_port()
1543 static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_create_queue() argument
1548 q = snd_seq_queue_alloc(client->number, info->locked, info->flags); in snd_seq_ioctl_create_queue()
1566 static int snd_seq_ioctl_delete_queue(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_delete_queue() argument
1570 return snd_seq_queue_delete(client->number, info->queue); in snd_seq_ioctl_delete_queue()
1574 static int snd_seq_ioctl_get_queue_info(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_info() argument
1595 static int snd_seq_ioctl_set_queue_info(struct snd_seq_client *client, in snd_seq_ioctl_set_queue_info() argument
1601 if (info->owner != client->number) in snd_seq_ioctl_set_queue_info()
1605 if (snd_seq_queue_check_access(info->queue, client->number)) { in snd_seq_ioctl_set_queue_info()
1606 if (snd_seq_queue_set_owner(info->queue, client->number, info->locked) < 0) in snd_seq_ioctl_set_queue_info()
1609 snd_seq_queue_use(info->queue, client->number, 1); in snd_seq_ioctl_set_queue_info()
1617 if (q->owner != client->number) { in snd_seq_ioctl_set_queue_info()
1628 static int snd_seq_ioctl_get_named_queue(struct snd_seq_client *client, in snd_seq_ioctl_get_named_queue() argument
1646 static int snd_seq_ioctl_get_queue_status(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_status() argument
1675 static int snd_seq_ioctl_get_queue_tempo(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_tempo() argument
1701 int snd_seq_set_queue_tempo(int client, struct snd_seq_queue_tempo *tempo) in snd_seq_set_queue_tempo() argument
1703 if (!snd_seq_queue_check_access(tempo->queue, client)) in snd_seq_set_queue_tempo()
1705 return snd_seq_queue_timer_set_tempo(tempo->queue, client, tempo); in snd_seq_set_queue_tempo()
1709 static int snd_seq_ioctl_set_queue_tempo(struct snd_seq_client *client, in snd_seq_ioctl_set_queue_tempo() argument
1715 result = snd_seq_set_queue_tempo(client->number, tempo); in snd_seq_ioctl_set_queue_tempo()
1721 static int snd_seq_ioctl_get_queue_timer(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_timer() argument
1750 static int snd_seq_ioctl_set_queue_timer(struct snd_seq_client *client, in snd_seq_ioctl_set_queue_timer() argument
1759 if (snd_seq_queue_check_access(timer->queue, client->number)) { in snd_seq_ioctl_set_queue_timer()
1786 static int snd_seq_ioctl_get_queue_client(struct snd_seq_client *client, in snd_seq_ioctl_get_queue_client() argument
1792 used = snd_seq_queue_is_used(info->queue, client->number); in snd_seq_ioctl_get_queue_client()
1796 info->client = client->number; in snd_seq_ioctl_get_queue_client()
1803 static int snd_seq_ioctl_set_queue_client(struct snd_seq_client *client, in snd_seq_ioctl_set_queue_client() argument
1810 err = snd_seq_queue_use(info->queue, client->number, info->used); in snd_seq_ioctl_set_queue_client()
1815 return snd_seq_ioctl_get_queue_client(client, arg); in snd_seq_ioctl_set_queue_client()
1820 static int snd_seq_ioctl_get_client_pool(struct snd_seq_client *client, in snd_seq_ioctl_get_client_pool() argument
1826 cptr = snd_seq_client_use_ptr(info->client); in snd_seq_ioctl_get_client_pool()
1830 info->client = cptr->number; in snd_seq_ioctl_get_client_pool()
1849 static int snd_seq_ioctl_set_client_pool(struct snd_seq_client *client, in snd_seq_ioctl_set_client_pool() argument
1855 if (client->number != info->client) in snd_seq_ioctl_set_client_pool()
1859 (! snd_seq_write_pool_allocated(client) || in snd_seq_ioctl_set_client_pool()
1860 info->output_pool != client->pool->size)) { in snd_seq_ioctl_set_client_pool()
1861 if (snd_seq_write_pool_allocated(client)) { in snd_seq_ioctl_set_client_pool()
1863 if (atomic_read(&client->pool->counter)) in snd_seq_ioctl_set_client_pool()
1866 snd_seq_pool_mark_closing(client->pool); in snd_seq_ioctl_set_client_pool()
1867 snd_seq_pool_done(client->pool); in snd_seq_ioctl_set_client_pool()
1869 client->pool->size = info->output_pool; in snd_seq_ioctl_set_client_pool()
1870 rc = snd_seq_pool_init(client->pool); in snd_seq_ioctl_set_client_pool()
1874 if (client->type == USER_CLIENT && client->data.user.fifo != NULL && in snd_seq_ioctl_set_client_pool()
1877 info->input_pool != client->data.user.fifo_pool_size) { in snd_seq_ioctl_set_client_pool()
1879 rc = snd_seq_fifo_resize(client->data.user.fifo, info->input_pool); in snd_seq_ioctl_set_client_pool()
1882 client->data.user.fifo_pool_size = info->input_pool; in snd_seq_ioctl_set_client_pool()
1885 info->output_room <= client->pool->size) { in snd_seq_ioctl_set_client_pool()
1886 client->pool->room = info->output_room; in snd_seq_ioctl_set_client_pool()
1889 return snd_seq_ioctl_get_client_pool(client, arg); in snd_seq_ioctl_set_client_pool()
1894 static int snd_seq_ioctl_remove_events(struct snd_seq_client *client, in snd_seq_ioctl_remove_events() argument
1907 if (client->type == USER_CLIENT && client->data.user.fifo) in snd_seq_ioctl_remove_events()
1908 snd_seq_fifo_clear(client->data.user.fifo); in snd_seq_ioctl_remove_events()
1912 snd_seq_queue_remove_cells(client->number, info); in snd_seq_ioctl_remove_events()
1921 static int snd_seq_ioctl_get_subscription(struct snd_seq_client *client, in snd_seq_ioctl_get_subscription() argument
1930 if ((sender = snd_seq_client_use_ptr(subs->sender.client)) == NULL) in snd_seq_ioctl_get_subscription()
1949 static int snd_seq_ioctl_query_subs(struct snd_seq_client *client, void *arg) in snd_seq_ioctl_query_subs() argument
1959 if ((cptr = snd_seq_client_use_ptr(subs->root.client)) == NULL) in snd_seq_ioctl_query_subs()
2012 static int snd_seq_ioctl_query_next_client(struct snd_seq_client *client, in snd_seq_ioctl_query_next_client() argument
2019 if (info->client < INT_MAX) in snd_seq_ioctl_query_next_client()
2020 info->client++; in snd_seq_ioctl_query_next_client()
2021 if (info->client < 0) in snd_seq_ioctl_query_next_client()
2022 info->client = 0; in snd_seq_ioctl_query_next_client()
2023 for (; info->client < SNDRV_SEQ_MAX_CLIENTS; info->client++) { in snd_seq_ioctl_query_next_client()
2024 cptr = snd_seq_client_use_ptr(info->client); in snd_seq_ioctl_query_next_client()
2040 static int snd_seq_ioctl_query_next_port(struct snd_seq_client *client, in snd_seq_ioctl_query_next_port() argument
2047 cptr = snd_seq_client_use_ptr(info->addr.client); in snd_seq_ioctl_query_next_port()
2072 int (*func)(struct snd_seq_client *client, void *arg);
2111 struct snd_seq_client *client = file->private_data; in snd_seq_ioctl() local
2134 if (snd_BUG_ON(!client)) in snd_seq_ioctl()
2156 mutex_lock(&client->ioctl_mutex); in snd_seq_ioctl()
2157 err = handler->func(client, &buf); in snd_seq_ioctl()
2158 mutex_unlock(&client->ioctl_mutex); in snd_seq_ioctl()
2184 struct snd_seq_client *client; in snd_seq_create_kernel_client() local
2205 client = seq_create_client1(client_index, 0); in snd_seq_create_kernel_client()
2206 if (client == NULL) { in snd_seq_create_kernel_client()
2212 client->accept_input = 1; in snd_seq_create_kernel_client()
2213 client->accept_output = 1; in snd_seq_create_kernel_client()
2214 client->data.kernel.card = card; in snd_seq_create_kernel_client()
2217 vsnprintf(client->name, sizeof(client->name), name_fmt, args); in snd_seq_create_kernel_client()
2220 client->type = KERNEL_CLIENT; in snd_seq_create_kernel_client()
2224 snd_seq_system_client_ev_client_start(client->number); in snd_seq_create_kernel_client()
2227 return client->number; in snd_seq_create_kernel_client()
2232 int snd_seq_delete_kernel_client(int client) in snd_seq_delete_kernel_client() argument
2239 ptr = clientptr(client); in snd_seq_delete_kernel_client()
2254 int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, in snd_seq_kernel_client_enqueue() argument
2269 ev->source.client = client; in snd_seq_kernel_client_enqueue()
2274 cptr = snd_seq_client_use_ptr(client); in snd_seq_kernel_client_enqueue()
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()