• Home
  • Raw
  • Download

Lines Matching refs:event

67 			      struct snd_seq_event *event,
70 struct snd_seq_event *event,
442 if (snd_seq_ev_is_variable(&cell->event)) { in snd_seq_read()
444 tmpev = cell->event; in snd_seq_read()
452 err = snd_seq_expand_var_event(&cell->event, count, in snd_seq_read()
461 if (copy_to_user(buf, &cell->event, sizeof(struct snd_seq_event))) { in snd_seq_read()
499 static struct snd_seq_client *get_event_dest_client(struct snd_seq_event *event, in get_event_dest_client() argument
504 dest = snd_seq_client_use_ptr(event->dest.client); in get_event_dest_client()
510 ! test_bit(event->type, dest->event_filter)) in get_event_dest_client()
534 struct snd_seq_event *event, in bounce_error_event() argument
553 bounce_ev.dest.port = event->source.port; in bounce_error_event()
554 bounce_ev.data.quote.origin = event->dest; in bounce_error_event()
555 bounce_ev.data.quote.event = event; in bounce_error_event()
572 static int update_timestamp_of_queue(struct snd_seq_event *event, in update_timestamp_of_queue() argument
580 event->queue = queue; in update_timestamp_of_queue()
581 event->flags &= ~SNDRV_SEQ_TIME_STAMP_MASK; in update_timestamp_of_queue()
583 event->time.time = snd_seq_timer_get_cur_time(q->timer, true); in update_timestamp_of_queue()
584 event->flags |= SNDRV_SEQ_TIME_STAMP_REAL; in update_timestamp_of_queue()
586 event->time.tick = snd_seq_timer_get_cur_tick(q->timer); in update_timestamp_of_queue()
587 event->flags |= SNDRV_SEQ_TIME_STAMP_TICK; in update_timestamp_of_queue()
602 struct snd_seq_event *event, in snd_seq_deliver_single_event() argument
610 direct = snd_seq_ev_is_direct(event); in snd_seq_deliver_single_event()
612 dest = get_event_dest_client(event, filter); in snd_seq_deliver_single_event()
615 dest_port = snd_seq_port_use_ptr(dest, event->dest.port); in snd_seq_deliver_single_event()
626 update_timestamp_of_queue(event, dest_port->time_queue, in snd_seq_deliver_single_event()
632 result = snd_seq_fifo_event_in(dest->data.user.fifo, event); in snd_seq_deliver_single_event()
638 result = dest_port->event_input(event, direct, in snd_seq_deliver_single_event()
653 result = bounce_error_event(client, event, result, atomic, hop); in snd_seq_deliver_single_event()
663 struct snd_seq_event *event, in deliver_to_subscribers() argument
672 src_port = snd_seq_port_use_ptr(client, event->source.port); in deliver_to_subscribers()
676 event_saved = *event; in deliver_to_subscribers()
688 event->dest = subs->info.dest; in deliver_to_subscribers()
691 update_timestamp_of_queue(event, subs->info.queue, in deliver_to_subscribers()
693 err = snd_seq_deliver_single_event(client, event, in deliver_to_subscribers()
703 *event = event_saved; in deliver_to_subscribers()
709 *event = event_saved; /* restore */ in deliver_to_subscribers()
720 struct snd_seq_event *event, in port_broadcast_event() argument
727 dest_client = get_event_dest_client(event, SNDRV_SEQ_FILTER_BROADCAST); in port_broadcast_event()
733 event->dest.port = port->addr.port; in port_broadcast_event()
735 err = snd_seq_deliver_single_event(NULL, event, in port_broadcast_event()
748 event->dest.port = SNDRV_SEQ_ADDRESS_BROADCAST; /* restore */ in port_broadcast_event()
757 struct snd_seq_event *event, int atomic, int hop) in broadcast_event() argument
763 addr = event->dest; /* save */ in broadcast_event()
769 event->dest.client = dest; in broadcast_event()
770 event->dest.port = addr.port; in broadcast_event()
772 err = port_broadcast_event(client, event, atomic, hop); in broadcast_event()
775 err = snd_seq_deliver_single_event(NULL, event, in broadcast_event()
786 event->dest = addr; /* restore */ 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()
822 if (snd_seq_ev_is_variable(event) && in snd_seq_deliver_event()
823 snd_BUG_ON(atomic && (event->data.ext.len & SNDRV_SEQ_EXT_USRPTR))) in snd_seq_deliver_event()
826 if (event->queue == SNDRV_SEQ_ADDRESS_SUBSCRIBERS || 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()
830 else if (event->queue == SNDRV_SEQ_ADDRESS_BROADCAST || 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()
835 else if (event->dest.port == SNDRV_SEQ_ADDRESS_BROADCAST) 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()
862 client = snd_seq_client_use_ptr(cell->event.source.client); in snd_seq_dispatch_event()
868 if (cell->event.type == SNDRV_SEQ_EVENT_NOTE) { in snd_seq_dispatch_event()
876 tmpev = cell->event; in snd_seq_dispatch_event()
885 ev = &cell->event; in snd_seq_dispatch_event()
913 result = snd_seq_deliver_event(client, &cell->event, atomic, hop); in snd_seq_dispatch_event()
927 struct snd_seq_event *event, in snd_seq_client_enqueue_event() argument
936 if (event->queue == SNDRV_SEQ_ADDRESS_SUBSCRIBERS) { in snd_seq_client_enqueue_event()
937 event->dest.client = SNDRV_SEQ_ADDRESS_SUBSCRIBERS; in snd_seq_client_enqueue_event()
938 event->queue = SNDRV_SEQ_QUEUE_DIRECT; in snd_seq_client_enqueue_event()
941 if (event->queue == SNDRV_SEQ_ADDRESS_BROADCAST) { in snd_seq_client_enqueue_event()
942 event->dest.client = SNDRV_SEQ_ADDRESS_BROADCAST; in snd_seq_client_enqueue_event()
943 event->queue = SNDRV_SEQ_QUEUE_DIRECT; 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()
955 if (snd_seq_ev_is_direct(event)) { in snd_seq_client_enqueue_event()
956 if (event->type == SNDRV_SEQ_EVENT_NOTE) 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()
968 err = snd_seq_event_dup(client->pool, event, &cell, !blocking || atomic, in snd_seq_client_enqueue_event()
1026 struct snd_seq_event event; in snd_seq_write() local
1052 len = sizeof(event); in snd_seq_write()
1053 if (copy_from_user(&event, buf, len)) { in snd_seq_write()
1057 event.source.client = client->number; /* fill in client number */ in snd_seq_write()
1059 if (check_event_type_and_length(&event)) { in snd_seq_write()
1065 if (event.type == SNDRV_SEQ_EVENT_NONE) in snd_seq_write()
1067 else if (snd_seq_ev_is_reserved(&event)) { in snd_seq_write()
1072 if (snd_seq_ev_is_variable(&event)) { in snd_seq_write()
1073 int extlen = event.data.ext.len & ~SNDRV_SEQ_EXT_MASK; in snd_seq_write()
1080 event.data.ext.len = extlen | SNDRV_SEQ_EXT_USRPTR; in snd_seq_write()
1081 event.data.ext.ptr = (char __force *)buf in snd_seq_write()
1086 if (client->convert32 && snd_seq_ev_is_varusr(&event)) { in snd_seq_write()
1087 void *ptr = (void __force *)compat_ptr(event.data.raw32.d[1]); in snd_seq_write()
1088 event.data.ext.ptr = ptr; in snd_seq_write()
1094 err = snd_seq_client_enqueue_event(client, &event, file, in snd_seq_write()
1450 struct snd_seq_event event; in snd_seq_client_notify_subscription() local
1452 memset(&event, 0, sizeof(event)); in snd_seq_client_notify_subscription()
1453 event.type = evtype; in snd_seq_client_notify_subscription()
1454 event.data.connect.dest = info->dest; in snd_seq_client_notify_subscription()
1455 event.data.connect.sender = info->sender; in snd_seq_client_notify_subscription()
1457 return snd_seq_system_notify(client, port, &event); /* non-atomic */ in snd_seq_client_notify_subscription()