Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int snd_seq_open(struct inode *inode, struct file *file) { int c, mode; struct snd_seq_client *client; struct snd_seq_user_client *user; int err; err = stream_open(inode, file); if (err < 0) return err; mutex_lock(&register_mutex); client = seq_create_client1(-1, SNDRV_SEQ_DEFAULT_EVENTS); ...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int bounce_error_event(struct snd_seq_client *client, struct snd_seq_event *event, int err, int atomic, int hop) { struct snd_seq_event bounce_ev; int result; if (client == NULL || !(client->filter & SNDRV_SEQ_FILTER_BOUNCE) || !client->acc...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int port_broadcast_event(struct snd_seq_client *client, struct snd_seq_event *event, int atomic, int hop) { int num_ev = 0, err, result = 0; struct snd_seq_client *dest_client; struct snd_seq_client_port *port; dest_client = get_event_dest_...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int broadcast_event(struct snd_seq_client *client, struct snd_seq_event *event, int atomic, int hop) { int err, result = 0, num_ev = 0; int dest; struct snd_seq_addr addr; addr = event->dest; for (dest = 0; dest < SNDRV_SEQ_MAX_CLIENTS; dest++) { /* don't send to itself...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int snd_seq_deliver_event(struct snd_seq_client *client, struct snd_seq_event *event, int atomic, int hop) { int result; hop++; if (hop >= SNDRV_SEQ_MAX_HOPS) { pr_debug("ALSA: seq: too long delivery path (%d:%d->%d:%d)\n", ...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int snd_seq_client_enqueue_event(struct snd_seq_client *client, struct snd_seq_event *event, struct file *file, int blocking, int atomic, int hop, struct...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int snd_seq_ioctl_client_id(struct snd_seq_client *client, void *arg) { int *client_id = arg; *client_id = client->number; return 0; }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int snd_seq_ioctl_running_mode(struct snd_seq_client *client, void *arg) { struct snd_seq_running_info *info = arg; struct snd_seq_client *cptr; int err = 0; cptr = snd_seq_client_use_ptr(info->client); if (cptr == NULL) return -ENOENT; /* don't change !!! */ ...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static void get_client_info(struct snd_seq_client *cptr, struct snd_seq_client_info *info) { info->client = cptr->number; info->type = cptr->type; strcpy(info->name, cptr->name); info->filter = cptr->filter; info->event_lost = cptr->event_lost; memcpy(info->event_filter, cptr->e...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int check_subscription_permission(struct snd_seq_client *client, struct snd_seq_client_port *sport, struct snd_seq_client_port *dport, struct snd_seq_port_subscribe *subs) { if (client->nu...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int snd_seq_ioctl_unsubscribe_port(struct snd_seq_client *client, void *arg) { struct snd_seq_port_subscribe *subs = arg; int result = -ENXIO; struct snd_seq_client *receiver = NULL, *sender = NULL; struct snd_seq_client_port *sport = NULL, *dport = NULL; rece...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int snd_seq_ioctl_get_queue_status(struct snd_seq_client *client, void *arg) { struct snd_seq_queue_status *status = arg; struct snd_seq_queue *queue; struct snd_seq_timer *tmr; queue = queueptr(status->queue); if (queue == NULL) return -EINVAL; memset(s...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int snd_seq_ioctl_get_queue_timer(struct snd_seq_client *client, void *arg) { struct snd_seq_queue_timer *timer = arg; struct snd_seq_queue *queue; struct snd_seq_timer *tmr; queue = queueptr(timer->queue); if (queue == NULL) return -EINVAL; mutex_lock(&...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int snd_seq_ioctl_get_subscription(struct snd_seq_client *client, void *arg) { struct snd_seq_port_subscribe *subs = arg; int result; struct snd_seq_client *sender = NULL; struct snd_seq_client_port *sport = NULL; result = -EINVAL; sender = snd_seq_client_us...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
static int snd_seq_ioctl_query_subs(struct snd_seq_client *client, void *arg) { struct snd_seq_query_subs *subs = arg; int result = -ENXIO; struct snd_seq_client *cptr = NULL; struct snd_seq_client_port *port = NULL; struct snd_seq_port_subs_info *group; struct list_head *p; int i; cptr = snd_seq_clien...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
int snd_seq_delete_kernel_client(int client) { struct snd_seq_client *ptr; if (snd_BUG_ON(in_interrupt())) return -EBUSY; ptr = clientptr(client); if (ptr == NULL) return -EINVAL; seq_free_client(ptr); kfree(ptr); return 0; }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_clientmgr.c
int __init snd_sequencer_device_init(void) { int err; snd_device_initialize(&seq_dev, NULL); dev_set_name(&seq_dev, "seq"); mutex_lock(&register_mutex); err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0, &snd_seq_f_ops, NULL, &seq_dev); mutex_unlock(&register_mutex...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_compat.c
static int snd_seq_call_port_info_ioctl(struct snd_seq_client *client, unsigned int cmd, struct snd_seq_port_info32 __user *data32) { int err = -EFAULT; struct snd_seq_port_info *data; data = kmalloc(sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; if (copy_from_user(...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_dummy.c
static int dummy_input(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop) { struct snd_seq_dummy_port *p; struct snd_seq_event tmpev; p = private_data; if (ev->source.client == SNDRV_SEQ_CLIENT_SYSTEM || ev->type == SNDRV_SEQ_EVENT_KERNEL_ERROR) retu...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_dummy.c
static int __init register_client(void) { struct snd_seq_dummy_port *rec1, *rec2; int i; if (ports < 1) { pr_err("ALSA: seq_dummy: invalid number of ports %d\n", ports); return -EINVAL; } my_client = snd_seq_create_kernel_client(NULL, SNDRV_SEQ_CLIENT_DUMMY, ...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_dummy.c
static int __init alsa_seq_dummy_init(void) { return register_client(); }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_fifo.c
struct snd_seq_fifo *snd_seq_fifo_new(int poolsize) { struct snd_seq_fifo *f; f = kzalloc(sizeof(*f), GFP_KERNEL); if (!f) return NULL; f->pool = snd_seq_pool_new(poolsize); if (f->pool == NULL) { kfree(f); return NULL; } if (snd_seq_pool_init(f->pool) < 0) { snd_seq_pool_delete(&f->pool...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_fifo.c
static struct snd_seq_event_cell *fifo_cell_out(struct snd_seq_fifo *f) { struct snd_seq_event_cell *cell; cell = f->head; if (cell) { f->head = cell->next; if (f->tail == cell) f->tail = NULL; cell->next = NULL; f->cells--; } return cell; }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_fifo.c
void snd_seq_fifo_cell_putback(struct snd_seq_fifo *f, struct snd_seq_event_cell *cell) { unsigned long flags; if (cell) { spin_lock_irqsave(&f->lock, flags); cell->next = f->head; f->head = cell; if (!f->tail) f->tail = cell; f->cells++; spin_unlock_i...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_fifo.c
int snd_seq_fifo_resize(struct snd_seq_fifo *f, int poolsize) { struct snd_seq_pool *newpool, *oldpool; struct snd_seq_event_cell *cell, *next, *oldhead; if (snd_BUG_ON(!f || !f->pool)) return -EINVAL; newpool = snd_seq_pool_new(poolsize); if (newpool == NULL) return -ENOMEM; if (snd_seq_pool_init...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_memory.c
int snd_seq_dump_var_event(const struct snd_seq_event *event, snd_seq_dump_func_t func, void *private_data) { int len, err; struct snd_seq_event_cell *cell; len = get_var_len(event); if (len <= 0) return len; if (event->data.ext.len & SNDRV_SEQ_EXT_USRPTR) { char buf[32];...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_memory.c
void snd_seq_pool_mark_closing(struct snd_seq_pool *pool) { unsigned long flags; if (snd_BUG_ON(!pool)) return; spin_lock_irqsave(&pool->lock, flags); pool->closing = 1; spin_unlock_irqrestore(&pool->lock, flags); }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_memory.h
static inline int snd_seq_unused_cells(struct snd_seq_pool *pool) { return pool ? pool->total_elements - atomic_read(&pool->counter) : 0; }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_midi.c
static int midisynth_use(void *private_data, struct snd_seq_port_subscribe *info) { int err; struct seq_midisynth *msynth = private_data; struct snd_rawmidi_params params; err = snd_rawmidi_kernel_open(msynth->card, msynth->device, msynth->subdevice, ...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_midi.c
static void snd_seq_midisynth_delete(struct seq_midisynth *msynth) { if (msynth == NULL) return; if (msynth->seq_client > 0) { snd_seq_event_port_detach(msynth->seq_client, msynth->seq_port); } snd_midi_event_free(msynth->parser); }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_midi_emul.c
static void all_sounds_off(const struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan) { int n; if (!ops->note_terminate) return; for (n = 0; n < 128; n++) { if (chan->note[n]) { ops->note_terminate(drv, n, chan); chan->note[n] = 0; } } }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_midi_event.c
void snd_midi_event_free(struct snd_midi_event *dev) { if (dev != NULL) { kfree(dev->buf); kfree(dev); } }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_midi_event.c
static void two_param_ctrl_event(struct snd_midi_event *dev, struct snd_seq_event *ev) { ev->data.control.channel = dev->buf[0] & 0x0f; ev->data.control.param = dev->buf[1]; ev->data.control.value = dev->buf[2]; }
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_midi_event.c
static int extra_decode_ctrl14(struct snd_midi_event *dev, unsigned char *buf, int count, struct snd_seq_event *ev) { unsigned char cmd; int idx = 0; cmd = MIDI_CMD_CONTROL | (ev->data.control.channel & 0x0f); if (ev->data.control.param < 0x20) { if (count < 4) return -...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_ports.c
static void port_subs_info_init(struct snd_seq_port_subs_info *grp) { INIT_LIST_HEAD(&grp->list_head); grp->count = 0; grp->exclusive = 0; rwlock_init(&grp->list_lock); init_rwsem(&grp->list_mutex); grp->open = NULL; grp->close = NULL; }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_ports.c
struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client, int port) { struct snd_seq_client_port *new_port, *p; int num = -1; if (snd_BUG_ON(!client)) return NULL; if (client->num_ports >= SNDRV_SEQ_MAX_PORTS) { pr_warn("ALSA: seq: t...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_ports.c
static inline struct snd_seq_subscribers *get_subscriber(struct list_head *p, bool is_src) { if (is_src) return list_entry(p, struct snd_seq_subscribers, src_list); else return list_entry(p, struct snd_seq_subscribers, dest_list); }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_ports.c
static void clear_subscriber_list(struct snd_seq_client *client, struct snd_seq_client_port *port, struct snd_seq_port_subs_info *grp, int is_src) { struct list_head *p, *n; list_for_each_safe(p, n, &grp->list_hea...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_ports.c
int snd_seq_delete_port(struct snd_seq_client *client, int port) { struct snd_seq_client_port *found = NULL, *p; mutex_lock(&client->ports_mutex); write_lock_irq(&client->ports_lock); list_for_each_entry(p, &client->ports_list_head, list) { if (p->addr.port == port) { list_del(&p->list); clien...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_ports.c
int snd_seq_set_port_info(struct snd_seq_client_port *port, struct snd_seq_port_info *info) { if (snd_BUG_ON(!port || !info)) return -EINVAL; if (info->name[0]) strscpy(port->name, info->name, sizeof(port->name)); /* set capabilities */ port->capability = info->capability; ...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_ports.c
int snd_seq_get_port_info(struct snd_seq_client_port *port, struct snd_seq_port_info *info) { if (snd_BUG_ON(!port || !info)) return -EINVAL; strscpy(info->name, port->name, sizeof(info->name)); /* get capabilities */ info->capability = port->capability; /* get port type */ ...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_ports.c
static inline int addr_match(struct snd_seq_addr *r, struct snd_seq_addr *s) { return (r->client == s->client) && (r->port == s->port); }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_ports.c
int snd_seq_port_connect(struct snd_seq_client *connector, struct snd_seq_client *src_client, struct snd_seq_client_port *src_port, struct snd_seq_client *dest_client, struct snd_seq_client_port *dest_port, ...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_ports.c
int snd_seq_port_get_subscription(struct snd_seq_port_subs_info *src_grp, struct snd_seq_addr *dest_addr, struct snd_seq_port_subscribe *subs) { struct snd_seq_subscribers *s; int err = -ENOENT; down_read(&src_grp->list_mutex); list_for_each_e...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_ports.c
int snd_seq_event_port_attach(int client, struct snd_seq_port_callback *pcbp, int cap, int type, int midi_channels, int midi_voices, char *portname) { struct snd_seq_port_info portinfo; int ret; memset(&portinfo, 0, sizeof(portinfo)); portinfo.addr.cl...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_prioq.c
struct snd_seq_prioq *snd_seq_prioq_new(void) { struct snd_seq_prioq *f; f = kzalloc(sizeof(*f), GFP_KERNEL); if (!f) return NULL; spin_lock_init(&f->lock); f->head = NULL; f->tail = NULL; f->cells = 0; return f; }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_prioq.c
static int event_is_ready(struct snd_seq_event *ev, void *current_time) { if ((ev->flags & SNDRV_SEQ_TIME_STAMP_MASK) == SNDRV_SEQ_TIME_STAMP_TICK) return snd_seq_compare_tick_time(current_time, &ev->time.tick); else return snd_seq_compare_real_time(current_time, &ev->time.time); }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_prioq.c
void snd_seq_prioq_remove_events(struct snd_seq_prioq *f, int client, struct snd_seq_remove_events *info) { struct snd_seq_event_cell *cell, *next; unsigned long flags; struct snd_seq_event_cell *prev = NULL; struct snd_seq_event_cell *freefirst = NULL, *freeprev = NULL, *freene...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_queue.c
static int queue_list_add(struct snd_seq_queue *q) { int i; unsigned long flags; spin_lock_irqsave(&queue_list_lock, flags); for (i = 0; i < SNDRV_SEQ_MAX_QUEUES; i++) { if (!queue_list[i]) { queue_list[i] = q; q->queue = i; num_queues++; spin_unlock_irqrestore(&queue_list_lock, fla...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_queue.c
static struct snd_seq_queue *queue_list_remove(int id, int client) { struct snd_seq_queue *q; unsigned long flags; spin_lock_irqsave(&queue_list_lock, flags); q = queue_list[id]; if (q) { spin_lock(&q->owner_lock); if (q->owner == client) { q->klocked = 1; spin_unlock(&q->owner_lock); ...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_queue.c
static void queue_delete(struct snd_seq_queue *q) { mutex_lock(&q->timer_mutex); snd_seq_timer_stop(q->timer); snd_seq_timer_close(q); mutex_unlock(&q->timer_mutex); /* wait until access free */ snd_use_lock_sync(&q->use_lock); /* release resources... */ snd_seq_prioq_delete(&q->tickq); snd_seq_prioq...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_queue.c
struct snd_seq_queue *queueptr(int queueid) { struct snd_seq_queue *q; unsigned long flags; if (queueid < 0 || queueid >= SNDRV_SEQ_MAX_QUEUES) return NULL; spin_lock_irqsave(&queue_list_lock, flags); q = queue_list[queueid]; if (q) snd_use_lock_use(&q->use_lock); spin_unlock_irqrestore(&queue_li...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_queue.c
void snd_seq_check_queue(struct snd_seq_queue *q, int atomic, int hop) { unsigned long flags; struct snd_seq_event_cell *cell; snd_seq_tick_time_t cur_tick; snd_seq_real_time_t cur_time; int processed = 0; if (q == NULL) return; spin_lock_irqsave(&q->check_lock, flags); if (q->check_blocked) { ...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_queue.c
int snd_seq_queue_check_access(int queueid, int client) { struct snd_seq_queue *q = queueptr(queueid); int access_ok; unsigned long flags; if (!q) return 0; spin_lock_irqsave(&q->owner_lock, flags); access_ok = check_access(q, client); spin_unlock_irqrestore(&q->owner_lock, flags); queuefree(q); ...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_queue.c
int snd_seq_queue_timer_open(int queueid) { int result = 0; struct snd_seq_queue *queue; struct snd_seq_timer *tmr; queue = queueptr(queueid); if (queue == NULL) return -EINVAL; tmr = queue->timer; result = snd_seq_timer_open(queue); if (result < 0) { snd_seq_timer_defaults(tmr); result = s...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_queue.c
int snd_seq_queue_is_used(int queueid, int client) { struct snd_seq_queue *q; int result; q = queueptr(queueid); if (q == NULL) return -EINVAL; result = test_bit(client, q->clients_bitmap) ? 1 : 0; queuefree(q); return result; }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_queue.c
void snd_seq_queue_client_leave_cells(int client) { int i; struct snd_seq_queue *q; for (i = 0; i < SNDRV_SEQ_MAX_QUEUES; i++) { q = queueptr(i); if (!q) continue; snd_seq_prioq_leave(q->tickq, client, 0); snd_seq_prioq_leave(q->timeq, client, 0); queuefree(q); } }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_queue.c
void snd_seq_queue_remove_cells(int client, struct snd_seq_remove_events *info) { int i; struct snd_seq_queue *q; for (i = 0; i < SNDRV_SEQ_MAX_QUEUES; i++) { q = queueptr(i); if (!q) continue; if (test_bit(client, q->clients_bitmap) && (!(info->remove_mo...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_queue.c
void snd_seq_info_queues_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { int i, bpm; struct snd_seq_queue *q; struct snd_seq_timer *tmr; bool locked; int owner; for (i = 0; i < SNDRV_SEQ_MAX_QUEUES; i++) { q = queueptr(i); if (!q) continue; ...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_timer.c
struct snd_seq_timer *snd_seq_timer_new(void) { struct snd_seq_timer *tmr; tmr = kzalloc(sizeof(*tmr), GFP_KERNEL); if (!tmr) return NULL; spin_lock_init(&tmr->lock); snd_seq_timer_defaults(tmr); /* reset time */ snd_seq_timer_reset(tmr); return tmr; }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_timer.c
/* called by timer interrupt routine. the period time since previous invocation * is passed */ static void snd_seq_timer_interrupt(struct snd_timer_instance *timeri, unsigned long resolution, unsigned long ticks) { unsigned long flags; struct ...
[ 0, 1 ]
Linux Kernel
sound/core/seq/seq_timer.c
int snd_seq_timer_set_tempo(struct snd_seq_timer *tmr, int tempo) { unsigned long flags; if (snd_BUG_ON(!tmr)) return -EINVAL; if (tempo <= 0) return -EINVAL; spin_lock_irqsave(&tmr->lock, flags); if ((unsigned int)tempo != tmr->tempo) { tmr->tempo = tempo; snd_seq_timer_set_tick_resolution(t...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_timer.c
int snd_seq_timer_set_skew(struct snd_seq_timer *tmr, unsigned int skew, unsigned int base) { unsigned long flags; if (snd_BUG_ON(!tmr)) return -EINVAL; /* FIXME */ if (base != SKEW_BASE) { pr_debug("ALSA: seq: invalid skew base 0x%x\n", base); return -EINVAL; } spin...
[ 0, 1 ]
Linux Kernel
sound/core/seq/seq_timer.c
int snd_seq_timer_close(struct snd_seq_queue *q) { struct snd_seq_timer *tmr; struct snd_timer_instance *t; tmr = q->timer; if (snd_BUG_ON(!tmr)) return -EINVAL; spin_lock_irq(&tmr->lock); t = tmr->timeri; tmr->timeri = NULL; spin_unlock_irq(&tmr->lock); if (t) { snd_timer_close(t); snd_...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_timer.c
static int seq_timer_stop(struct snd_seq_timer *tmr) { if (!tmr->timeri) return -EINVAL; if (!tmr->running) return 0; tmr->running = 0; snd_timer_pause(tmr->timeri); return 0; }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_timer.c
static int seq_timer_continue(struct snd_seq_timer *tmr) { if (!tmr->timeri) return -EINVAL; if (tmr->running) return -EBUSY; if (!tmr->initialized) { seq_timer_reset(tmr); if (initialize_timer(tmr) < 0) return -EINVAL; } snd_timer_start(tmr->timeri, tmr->ticks); tmr->running = 1; k...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_timer.c
snd_seq_tick_time_t snd_seq_timer_get_cur_tick(struct snd_seq_timer *tmr) { snd_seq_tick_time_t cur_tick; unsigned long flags; spin_lock_irqsave(&tmr->lock, flags); cur_tick = tmr->tick.cur_tick; spin_unlock_irqrestore(&tmr->lock, flags); return cur_tick; }
[ 0, 1 ]
Linux Kernel
sound/core/seq/seq_timer.h
static inline void snd_seq_timer_update_tick(struct snd_seq_timer_tick *tick, unsigned long resolution) { if (tick->resolution > 0) { tick->fraction += resolution; tick->cur_tick += (unsigned int)(tick->fraction / tick->resolution); tick->fraction %= tick->reso...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_timer.h
static inline int snd_seq_compare_real_time(snd_seq_real_time_t *a, snd_seq_real_time_t *b) { if (a->tv_sec > b->tv_sec) return 1; if ((a->tv_sec == b->tv_sec) && (a->tv_nsec >= b->tv_nsec)) return 1; return 0; }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_timer.h
static inline void snd_seq_inc_time_nsec(snd_seq_real_time_t *tm, unsigned long nsec) { tm->tv_nsec += nsec; snd_seq_sanity_real_time(tm); }
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_virmidi.c
/* * initialize an event record */ static void snd_virmidi_init_event(struct snd_virmidi *vmidi, struct snd_seq_event *ev) { memset(ev, 0, sizeof(*ev)); ev->source.port = vmidi->port; switch (vmidi->seq_mode) { case SNDRV_VIRMIDI_SEQ_DISPATCH: ev->dest.client = SNDRV_SEQ...
[ 1, 1 ]
Linux Kernel
sound/core/seq/seq_virmidi.c
static int snd_virmidi_dev_receive_event(struct snd_virmidi_dev *rdev, struct snd_seq_event *ev, bool atomic) { struct snd_virmidi *vmidi; unsigned char msg[4]; int len; if (atomic) read_lock(&rdev->filelist_lock); else ...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_virmidi.c
static int snd_virmidi_event_input(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop) { struct snd_virmidi_dev *rdev; rdev = private_data; if (!(rdev->flags & SNDRV_VIRMIDI_USE)) return 0; return snd_virmidi_dev_receive_event(rdev, ev, atomic);...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_virmidi.c
static void snd_vmidi_output_work(struct work_struct *work) { struct snd_virmidi *vmidi; struct snd_rawmidi_substream *substream; unsigned char input; int ret; vmidi = container_of(work, struct snd_virmidi, output_work); substream = vmidi->substream; if (vmidi->seq_mode == SNDRV_VIRMIDI_SEQ_DISPATCH && ...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_virmidi.c
static void snd_virmidi_output_trigger(struct snd_rawmidi_substream *substream, int up) { struct snd_virmidi *vmidi = substream->runtime->private_data; WRITE_ONCE(vmidi->trigger, !!up); if (up) queue_work(system_highpri_wq, &vmidi->output_work); }
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_virmidi.c
static int snd_virmidi_output_close(struct snd_rawmidi_substream *substream) { struct snd_virmidi *vmidi = substream->runtime->private_data; WRITE_ONCE(vmidi->trigger, false); cancel_work_sync(&vmidi->output_work); snd_midi_event_free(vmidi->parser); substream->runtime->private_data = NULL; kfree(vmidi); ...
[ 1, 0 ]
Linux Kernel
sound/core/seq/seq_virmidi.c
static int snd_virmidi_dev_register(struct snd_rawmidi *rmidi) { struct snd_virmidi_dev *rdev = rmidi->private_data; int err; switch (rdev->seq_mode) { case SNDRV_VIRMIDI_SEQ_DISPATCH: err = snd_virmidi_dev_attach_seq(rdev); if (err < 0) return err; break; case SNDRV_VIRMIDI_SEQ_ATTACH: ...
[ 0, 0 ]
Linux Kernel
sound/core/seq/seq_virmidi.c
static void snd_virmidi_free(struct snd_rawmidi *rmidi) { struct snd_virmidi_dev *rdev = rmidi->private_data; kfree(rdev); }
[ 0, 0 ]
Linux Kernel
sound/core/seq_device.c
void snd_seq_autoload_exit(void) { atomic_inc(&snd_seq_in_init); }
[ 0, 0 ]
Linux Kernel
sound/core/seq_device.c
void snd_seq_device_load_drivers(void) { queue_autoload_drivers(); flush_work(&autoload_work); }
[ 0, 0 ]
Linux Kernel
sound/core/seq_device.c
static inline void cancel_autoload_drivers(void) { cancel_work_sync(&autoload_work); } #else
[ 0, 0 ]
Linux Kernel
sound/core/seq_device.c
static inline void queue_autoload_drivers(void) {}
[ 0, 0 ]
Linux Kernel
sound/core/seq_device.c
static inline void cancel_autoload_drivers(void) {} #endif
[ 0, 0 ]
Linux Kernel
sound/core/seq_device.c
static int snd_seq_device_dev_disconnect(struct snd_device *device) { struct snd_seq_device *dev = device->device_data; device_del(&dev->dev); return 0; }
[ 0, 0 ]
Linux Kernel
sound/core/seq_device.c
int snd_seq_device_new(struct snd_card *card, int device, const char *id, int argsize, struct snd_seq_device **result) { struct snd_seq_device *dev; int err; static const struct snd_device_ops dops = { .dev_free = snd_seq_device_dev_free, .dev_register = snd_seq_device_dev_regis...
[ 0, 0 ]
Linux Kernel
sound/core/seq_device.c
void snd_seq_driver_unregister(struct snd_seq_driver *drv) { driver_unregister(&drv->driver); }
[ 0, 0 ]
Linux Kernel
sound/core/sound.c
static void snd_request_other(int minor) { char *str; switch (minor) { case SNDRV_MINOR_SEQUENCER: str = "snd-seq"; break; case SNDRV_MINOR_TIMER: str = "snd-timer"; break; default: return; } request_module(str); }
[ 0, 0 ]
Linux Kernel
sound/core/sound.c
static struct snd_minor *autoload_device(unsigned int minor) { int dev; mutex_unlock(&sound_mutex); dev = SNDRV_MINOR_DEVICE(minor); if (dev == SNDRV_MINOR_CONTROL) { /* /dev/aloadC? */ int card = SNDRV_MINOR_CARD(minor); struct snd_card *ref = snd_card_ref(card); if (!ref) snd_request_car...
[ 0, 0 ]
Linux Kernel
sound/core/sound.c
int snd_unregister_device(struct device *dev) { int minor; struct snd_minor *preg; mutex_lock(&sound_mutex); for (minor = 0; minor < ARRAY_SIZE(snd_minors); ++minor) { preg = snd_minors[minor]; if (preg && preg->dev == dev) { snd_minors[minor] = NULL; device_del(dev); kfree(preg); ...
[ 1, 0 ]
Linux Kernel
sound/core/sound.c
static void snd_minor_info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { int minor; struct snd_minor *mptr; mutex_lock(&sound_mutex); for (minor = 0; minor < SNDRV_OS_MINORS; ++minor) { mptr = snd_minors[minor]; if (!mptr) continue; if (...
[ 1, 0 ]
Linux Kernel
sound/core/sound.c
int __init snd_minor_info_init(void) { struct snd_info_entry *entry; entry = snd_info_create_module_entry(THIS_MODULE, "devices", NULL); if (!entry) return -ENOMEM; entry->c.text.read = snd_minor_info_read; return snd_info_register(entry); }
[ 0, 0 ]
Linux Kernel
sound/core/sound_oss.c
void *snd_lookup_oss_minor_data(unsigned int minor, int type) { struct snd_minor *mreg; void *private_data; if (minor >= ARRAY_SIZE(snd_oss_minors)) return NULL; mutex_lock(&sound_oss_mutex); mreg = snd_oss_minors[minor]; if (mreg && mreg->type == type) { private_data = mreg->private_data; if (...
[ 1, 0 ]
Linux Kernel
sound/core/sound_oss.c
int snd_unregister_oss_device(int type, struct snd_card *card, int dev) { int minor = snd_oss_kernel_minor(type, card, dev); int cidx = SNDRV_MINOR_OSS_CARD(minor); int track2 = -1; struct snd_minor *mptr; if (card && card->number >= SNDRV_MINOR_OSS_DEVICES) return 0; if (minor < 0) return minor; ...
[ 1, 0 ]
Linux Kernel
sound/core/sound_oss.c
static const char *snd_oss_device_type_name(int type) { switch (type) { case SNDRV_OSS_DEVICE_TYPE_MIXER: return "mixer"; case SNDRV_OSS_DEVICE_TYPE_SEQUENCER: case SNDRV_OSS_DEVICE_TYPE_MUSIC: return "sequencer"; case SNDRV_OSS_DEVICE_TYPE_PCM: return "digital audio"; case SNDRV_OSS_DEVICE_TYPE...
[ 0, 0 ]
Linux Kernel
sound/core/sound_oss.c
static void snd_minor_info_oss_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { int minor; struct snd_minor *mptr; mutex_lock(&sound_oss_mutex); for (minor = 0; minor < SNDRV_OSS_MINORS; ++minor) { mptr = snd_oss_minors[minor]; if (!mptr) c...
[ 1, 0 ]
Linux Kernel
sound/core/timer.c
struct snd_timer_instance *snd_timer_instance_new(const char *owner) { struct snd_timer_instance *timeri; timeri = kzalloc(sizeof(*timeri), GFP_KERNEL); if (timeri == NULL) return NULL; timeri->owner = kstrdup(owner, GFP_KERNEL); if (!timeri->owner) { kfree(timeri); return NULL; } INIT_LIST_H...
[ 0, 0 ]
Linux Kernel
sound/core/timer.c
static void snd_timer_request(struct snd_timer_id *tid) { switch (tid->dev_class) { case SNDRV_TIMER_CLASS_GLOBAL: if (tid->device < timer_limit) request_module("snd-timer-%i", tid->device); break; case SNDRV_TIMER_CLASS_CARD: case SNDRV_TIMER_CLASS_PCM: if (tid->card < snd_ecards_limit) ...
[ 1, 0 ]
Linux Kernel
sound/core/timer.c
static int snd_timer_check_slave(struct snd_timer_instance *slave) { struct snd_timer *timer; struct snd_timer_instance *master; int err = 0; /* FIXME: it's really dumb to look up all entries.. */ list_for_each_entry(timer, &snd_timer_list, device_list) { list_for_each_entry(master, &timer->open_list_hea...
[ 1, 1 ]
Linux Kernel
sound/core/timer.c
static int snd_timer_check_master(struct snd_timer_instance *master) { struct snd_timer_instance *slave, *tmp; int err = 0; list_for_each_entry_safe(slave, tmp, &snd_timer_slave_list, open_list) { err = check_matching_master_slave(master, slave); if (err < 0) break; } return err < 0 ? err : 0; ...
[ 0, 0 ]
Linux Kernel
sound/core/timer.c
static int snd_timer_start1(struct snd_timer_instance *timeri, bool start, unsigned long ticks) { struct snd_timer *timer; int result; unsigned long flags; timer = timeri->timer; if (!timer) return -EINVAL; spin_lock_irqsave(&timer->lock, flags); if (timeri->flags & SNDRV...
[ 1, 0 ]