Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/core/pcm_native.c | static int snd_pcm_action(const struct action_ops *ops,
struct snd_pcm_substream *substream,
snd_pcm_state_t state) {
struct snd_pcm_group *group;
int res;
group = snd_pcm_stream_group_ref(substream);
if (group)
res = snd_pcm_action_group(ops, substream, ... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c | static int snd_pcm_do_start(struct snd_pcm_substream *substream,
snd_pcm_state_t state) {
int err;
if (substream->runtime->trigger_master != substream)
return 0;
err = substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_START);
if (err == -EPIPE)
__snd_pcm_set_state(substr... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static void snd_pcm_post_start(struct snd_pcm_substream *substream,
snd_pcm_state_t state) {
struct snd_pcm_runtime *runtime = substream->runtime;
snd_pcm_trigger_tstamp(substream);
runtime->hw_ptr_jiffies = jiffies;
runtime->hw_ptr_buffer_jiffies = (runtime->buffer_size * HZ) / ... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c | static int snd_pcm_pre_stop(struct snd_pcm_substream *substream,
snd_pcm_state_t state) {
struct snd_pcm_runtime *runtime = substream->runtime;
if (runtime->state == SNDRV_PCM_STATE_OPEN)
return -EBADFD;
runtime->trigger_master = substream;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c | int snd_pcm_drain_done(struct snd_pcm_substream *substream) {
return snd_pcm_action_single(&snd_pcm_action_stop, substream,
SNDRV_PCM_STATE_SETUP);
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c | static int snd_pcm_do_pause(struct snd_pcm_substream *substream,
snd_pcm_state_t state) {
if (substream->runtime->trigger_master != substream)
return 0;
if (pause_pushed(state))
snd_pcm_update_hw_ptr(substream);
/* The jiffies check in snd_pcm_update_hw_ptr*() is done by
* ... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static void snd_pcm_undo_pause(struct snd_pcm_substream *substream,
snd_pcm_state_t state) {
if (substream->runtime->trigger_master == substream)
substream->ops->trigger(substream, pause_pushed(state)
? SNDRV_PCM_TRIGGER_PAUSE_RELEASE
... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static void snd_pcm_undo_resume(struct snd_pcm_substream *substream,
snd_pcm_state_t state) {
if (substream->runtime->trigger_master == substream &&
snd_pcm_running(substream))
substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_SUSPEND);
} | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static int snd_pcm_resume(struct snd_pcm_substream *substream) {
return snd_pcm_action_lock_irq(&snd_pcm_action_resume, substream,
ACTION_ARG_IGNORE);
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c | static int snd_pcm_xrun(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
int result;
snd_pcm_stream_lock_irq(substream);
switch (runtime->state) {
case SNDRV_PCM_STATE_XRUN:
result = 0;
break;
case SNDRV_PCM_STATE_RUNNING:
__snd_pcm_xrun(substream);
... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static int snd_pcm_do_reset(struct snd_pcm_substream *substream,
snd_pcm_state_t state) {
struct snd_pcm_runtime *runtime = substream->runtime;
int err = snd_pcm_ops_ioctl(substream, SNDRV_PCM_IOCTL1_RESET, NULL);
if (err < 0)
return err;
snd_pcm_stream_lock_irq(substream);
ru... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c | static int snd_pcm_drop(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime;
int result = 0;
if (PCM_RUNTIME_CHECK(substream))
return -ENXIO;
runtime = substream->runtime;
if (runtime->state == SNDRV_PCM_STATE_OPEN ||
runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
return -E... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static bool is_pcm_file(struct file *file) {
struct inode *inode = file_inode(file);
struct snd_pcm *pcm;
unsigned int minor;
if (!S_ISCHR(inode->i_mode) || imajor(inode) != snd_major)
return false;
minor = iminor(inode);
pcm = snd_lookup_minor_data(minor, SNDRV_DEVICE_TYPE_PCM_PLAYBACK);
if (!pcm)... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static void relink_to_local(struct snd_pcm_substream *substream) {
snd_pcm_stream_lock_nested(substream);
snd_pcm_group_assign(substream, &substream->self_group);
snd_pcm_stream_unlock(substream);
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c | static int snd_pcm_hw_rule_mul(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule) {
struct snd_interval t;
snd_interval_mul(hw_param_interval_c(params, rule->deps[0]),
hw_param_interval_c(params, rule->deps[1]), &t);
return snd_interval_refine(hw_para... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static int snd_pcm_hw_rule_mulkdiv(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule) {
struct snd_interval t;
snd_interval_mulkdiv(hw_param_interval_c(params, rule->deps[0]),
(unsigned long)rule->private,
hw_param_interv... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c | static int snd_pcm_release(struct inode *inode, struct file *file) {
struct snd_pcm *pcm;
struct snd_pcm_substream *substream;
struct snd_pcm_file *pcm_file;
pcm_file = file->private_data;
substream = pcm_file->substream;
if (snd_BUG_ON(!substream))
return -ENXIO;
pcm = substream->pcm;
snd_power_w... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c | static snd_pcm_sframes_t forward_appl_ptr(struct snd_pcm_substream *substream,
snd_pcm_uframes_t frames,
snd_pcm_sframes_t avail) {
struct snd_pcm_runtime *runtime = substream->runtime;
snd_pcm_sframes_t appl_ptr;
int ret;
if (... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c | static snd_pcm_sframes_t rewind_appl_ptr(struct snd_pcm_substream *substream,
snd_pcm_uframes_t frames,
snd_pcm_sframes_t avail) {
struct snd_pcm_runtime *runtime = substream->runtime;
snd_pcm_sframes_t appl_ptr;
int ret;
if (ava... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static snd_pcm_sframes_t snd_pcm_rewind(struct snd_pcm_substream *substream,
snd_pcm_uframes_t frames) {
snd_pcm_sframes_t ret;
if (frames == 0)
return 0;
snd_pcm_stream_lock_irq(substream);
ret = do_pcm_hwsync(substream);
if (!ret)
ret = rewind_appl_ptr(subs... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static int snd_pcm_delay(struct snd_pcm_substream *substream,
snd_pcm_sframes_t *delay) {
int err;
snd_pcm_stream_lock_irq(substream);
err = do_pcm_hwsync(substream);
if (delay && !err)
*delay = snd_pcm_calc_delay(substream);
snd_pcm_stream_unlock_irq(substream);
snd_pcm_dma_b... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static int snd_pcm_rewind_ioctl(struct snd_pcm_substream *substream,
snd_pcm_uframes_t __user *_frames) {
snd_pcm_uframes_t frames;
snd_pcm_sframes_t result;
if (get_user(frames, _frames))
return -EFAULT;
if (put_user(0, _frames))
return -EFAULT;
result = snd_pcm_rewi... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static int snd_pcm_forward_ioctl(struct snd_pcm_substream *substream,
snd_pcm_uframes_t __user *_frames) {
snd_pcm_uframes_t frames;
snd_pcm_sframes_t result;
if (get_user(frames, _frames))
return -EFAULT;
if (put_user(0, _frames))
return -EFAULT;
result = snd_pcm_fo... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static long snd_pcm_ioctl(struct file *file, unsigned int cmd,
unsigned long arg) {
struct snd_pcm_file *pcm_file;
pcm_file = file->private_data;
if (((cmd >> 8) & 0xff) != 'A')
return -ENOTTY;
return snd_pcm_common_ioctl(file, pcm_file->substream, cmd,
... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static ssize_t snd_pcm_read(struct file *file, char __user *buf, size_t count,
loff_t *offset) {
struct snd_pcm_file *pcm_file;
struct snd_pcm_substream *substream;
struct snd_pcm_runtime *runtime;
snd_pcm_sframes_t result;
pcm_file = file->private_data;
substream = pcm_file->s... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c | static __poll_t snd_pcm_poll(struct file *file, poll_table *wait) {
struct snd_pcm_file *pcm_file;
struct snd_pcm_substream *substream;
struct snd_pcm_runtime *runtime;
__poll_t mask, ok;
snd_pcm_uframes_t avail;
pcm_file = file->private_data;
substream = pcm_file->substream;
if (substream->stream == ... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c | static int snd_pcm_mmap_control(struct snd_pcm_substream *substream,
struct file *file,
struct vm_area_struct *area) {
return -ENXIO;
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c | int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *area) {
area->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
if (!substream->ops->page &&
!snd_dma_buffer_mmap(snd_pcm_get_dma_buf(substream), area))
return 0;
area->vm_ops = &snd_pcm_vm_ops_... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c | int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file,
struct vm_area_struct *area) {
struct snd_pcm_runtime *runtime;
long size;
unsigned long offset;
size_t dma_bytes;
int err;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
if (!(area->vm_flags & (V... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c | static int snd_pcm_fasync(int fd, struct file *file, int on) {
struct snd_pcm_file *pcm_file;
struct snd_pcm_substream *substream;
struct snd_pcm_runtime *runtime;
pcm_file = file->private_data;
substream = pcm_file->substream;
if (PCM_RUNTIME_CHECK(substream))
return -ENXIO;
runtime = substream->run... | [
0,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static void
snd_pcm_hw_convert_from_old_params(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_params_old *oparams) {
unsigned int i;
memset(params, 0, sizeof(*params));
params->flags = oparams->flags;
for (i = 0; i < ARRAY_SIZE(oparams->masks); i++)
params->masks[i]... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static int
snd_pcm_hw_refine_old_user(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params_old __user *_oparams) {
struct snd_pcm_hw_params *params;
struct snd_pcm_hw_params_old *oparams = NULL;
int err;
params = kmalloc(sizeof(*params), GFP_KERNEL);
if (!params)
retu... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c |
static int
snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params_old __user *_oparams) {
struct snd_pcm_hw_params *params;
struct snd_pcm_hw_params_old *oparams = NULL;
int err;
params = kmalloc(sizeof(*params), GFP_KERNEL);
if (!params)
retu... | [
1,
0
] |
Linux Kernel | sound/core/pcm_native.c | static unsigned long snd_pcm_get_unmapped_area(struct file *file,
unsigned long addr,
unsigned long len,
unsigned long pgoff,
unsign... | [
1,
0
] |
Linux Kernel | sound/core/pcm_timer.c |
static unsigned long snd_pcm_timer_resolution(struct snd_timer *timer) {
struct snd_pcm_substream *substream;
substream = timer->private_data;
return substream->runtime ? substream->runtime->timer_resolution : 0;
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_timer.c | static void snd_pcm_timer_free(struct snd_timer *timer) {
struct snd_pcm_substream *substream = timer->private_data;
substream->timer = NULL;
} | [
0,
0
] |
Linux Kernel | sound/core/pcm_timer.c |
void snd_pcm_timer_done(struct snd_pcm_substream *substream) {
if (substream->timer) {
snd_device_free(substream->pcm->card, substream->timer);
substream->timer = NULL;
}
} | [
0,
0
] |
Linux Kernel | sound/core/rawmidi.c |
static struct snd_rawmidi *snd_rawmidi_search(struct snd_card *card,
int device) {
struct snd_rawmidi *rawmidi;
list_for_each_entry(rawmidi, &snd_rawmidi_devices,
list) if (rawmidi->card == card &&
rawmidi->device ... | [
1,
0
] |
Linux Kernel | sound/core/rawmidi.c |
static bool snd_rawmidi_ready(struct snd_rawmidi_substream *substream) {
unsigned long flags;
bool ready;
spin_lock_irqsave(&substream->lock, flags);
ready = __snd_rawmidi_ready(substream->runtime);
spin_unlock_irqrestore(&substream->lock, flags);
return ready;
} | [
0,
0
] |
Linux Kernel | sound/core/rawmidi.c |
static void
snd_rawmidi_buffer_ref_sync(struct snd_rawmidi_substream *substream) {
int loop = HZ;
spin_lock_irq(&substream->lock);
while (substream->runtime->buffer_ref) {
spin_unlock_irq(&substream->lock);
if (!--loop) {
rmidi_err(substream->rmidi, "Buffer ref sync timeout\n");
return;
... | [
0,
0
] |
Linux Kernel | sound/core/rawmidi.c |
static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream,
int up) {
if (!substream->opened)
return;
substream->ops->trigger(substream, up);
if (!up)
cancel_work_sync(&substream->runtime->event_work);
} | [
0,
0
] |
Linux Kernel | sound/core/rawmidi.c | static int assign_substream(struct snd_rawmidi *rmidi, int subdevice,
int stream, int mode,
struct snd_rawmidi_substream **sub_ret) {
struct snd_rawmidi_substream *substream;
struct snd_rawmidi_str *s = &rmidi->streams[stream];
static const unsigned int info... | [
1,
0
] |
Linux Kernel | sound/core/rawmidi.c | static int open_substream(struct snd_rawmidi *rmidi,
struct snd_rawmidi_substream *substream, int mode) {
int err;
if (substream->use_count == 0) {
err = snd_rawmidi_runtime_create(substream);
if (err < 0)
return err;
err = substream->ops->open(substream);
if (err < ... | [
1,
0
] |
Linux Kernel | sound/core/rawmidi.c | int snd_rawmidi_kernel_open(struct snd_card *card, int device, int subdevice,
int mode, struct snd_rawmidi_file *rfile) {
struct snd_rawmidi *rmidi;
int err = 0;
if (snd_BUG_ON(!rfile))
return -EINVAL;
mutex_lock(®ister_mutex);
rmidi = snd_rawmidi_search(card, device);
i... | [
0,
0
] |
Linux Kernel | sound/core/rawmidi.c |
static int snd_rawmidi_info(struct snd_rawmidi_substream *substream,
struct snd_rawmidi_info *info) {
struct snd_rawmidi *rmidi;
if (substream == NULL)
return -ENODEV;
rmidi = substream->rmidi;
memset(info, 0, sizeof(*info));
info->card = rmidi->card->number;
info->device =... | [
1,
0
] |
Linux Kernel | sound/core/rawmidi.c |
static int snd_rawmidi_info_user(struct snd_rawmidi_substream *substream,
struct snd_rawmidi_info __user *_info) {
struct snd_rawmidi_info info;
int err;
err = snd_rawmidi_info(substream, &info);
if (err < 0)
return err;
if (copy_to_user(_info, &info, sizeof(struct snd_r... | [
1,
0
] |
Linux Kernel | sound/core/rawmidi.c |
int snd_rawmidi_info_select(struct snd_card *card,
struct snd_rawmidi_info *info) {
int ret;
mutex_lock(®ister_mutex);
ret = __snd_rawmidi_info_select(card, info);
mutex_unlock(®ister_mutex);
return ret;
} | [
0,
0
] |
Linux Kernel | sound/core/rawmidi.c |
static int resize_runtime_buffer(struct snd_rawmidi_substream *substream,
struct snd_rawmidi_params *params,
bool is_input) {
struct snd_rawmidi_runtime *runtime = substream->runtime;
char *newbuf, *oldbuf;
unsigned int framing = params->mode & SN... | [
1,
0
] |
Linux Kernel | sound/core/rawmidi.c |
static int receive_with_tstamp_framing(struct snd_rawmidi_substream *substream,
const unsigned char *buffer,
int src_count,
const struct timespec64 *tstamp) {
struct snd_rawmidi_runtime *runtime = sub... | [
1,
0
] |
Linux Kernel | sound/core/rawmidi.c | static long snd_rawmidi_kernel_read1(struct snd_rawmidi_substream *substream,
unsigned char __user *userbuf,
unsigned char *kernelbuf, long count) {
unsigned long flags;
long result = 0, count1;
struct snd_rawmidi_runtime *runtime = substre... | [
1,
0
] |
Linux Kernel | sound/core/rawmidi.c | int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream,
int count) {
int result;
unsigned long flags;
spin_lock_irqsave(&substream->lock, flags);
if (!substream->opened || !substream->runtime)
result = -EBADFD;
else
result = __snd_rawmidi_transmit_ack(substr... | [
0,
0
] |
Linux Kernel | sound/core/rawmidi.c | int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
unsigned char *buffer, int count) {
int result;
unsigned long flags;
spin_lock_irqsave(&substream->lock, flags);
if (!substream->opened)
result = -EBADFD;
else {
count = __snd_rawmidi_transmit_peek(substream, b... | [
0,
0
] |
Linux Kernel | sound/core/rawmidi.c |
long snd_rawmidi_kernel_write(struct snd_rawmidi_substream *substream,
const unsigned char *buf, long count) {
return snd_rawmidi_kernel_write1(substream, NULL, buf, count);
} | [
0,
0
] |
Linux Kernel | sound/core/rawmidi.c | static __poll_t snd_rawmidi_poll(struct file *file, poll_table *wait) {
struct snd_rawmidi_file *rfile;
struct snd_rawmidi_runtime *runtime;
__poll_t mask;
rfile = file->private_data;
if (rfile->input != NULL) {
runtime = rfile->input->runtime;
snd_rawmidi_input_trigger(rfile->input, 1);
poll_wai... | [
0,
0
] |
Linux Kernel | sound/core/rawmidi.c | static int snd_rawmidi_dev_disconnect(struct snd_device *device) {
struct snd_rawmidi *rmidi = device->device_data;
int dir;
mutex_lock(®ister_mutex);
mutex_lock(&rmidi->open_mutex);
wake_up(&rmidi->open_wait);
list_del_init(&rmidi->list);
for (dir = 0; dir < 2; dir++) {
struct snd_rawmidi_substre... | [
0,
0
] |
Linux Kernel | sound/core/rawmidi_compat.c |
static int snd_rawmidi_ioctl_status_compat64(
struct snd_rawmidi_file *rfile,
struct compat_snd_rawmidi_status64 __user *src) {
int err;
struct snd_rawmidi_status64 status;
struct compat_snd_rawmidi_status64 compat_status;
if (get_user(status.stream, &src->stream))
return -EFAULT;
switch (statu... | [
1,
0
] |
Linux Kernel | sound/core/rawmidi_compat.c |
static long snd_rawmidi_ioctl_compat(struct file *file, unsigned int cmd,
unsigned long arg) {
struct snd_rawmidi_file *rfile;
void __user *argp = compat_ptr(arg);
rfile = file->private_data;
switch (cmd) {
case SNDRV_RAWMIDI_IOCTL_PVERSION:
case SNDRV_RAWMIDI_IOCTL_IN... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss.c | static void unregister_device(void) {
mutex_lock(®ister_mutex);
if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC, NULL, 0) < 0)
pr_err("ALSA: seq_oss: error unregister device music\n");
if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0) < 0)
pr_err("ALSA: seq_oss: error un... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss.c |
static int __init register_proc(void) {
struct snd_info_entry *entry;
entry = snd_info_create_module_entry(THIS_MODULE, SNDRV_SEQ_OSS_PROCNAME,
snd_seq_root);
if (entry == NULL)
return -ENOMEM;
entry->content = SNDRV_INFO_CONTENT_TEXT;
entry->private_data = NULL;... | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss.c | static void unregister_proc(void) {
snd_info_free_entry(info_entry);
info_entry = NULL;
}
#endif | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_device.h | static inline int snd_seq_oss_control(struct seq_oss_devinfo *dp,
unsigned int type, void *arg) {
int err;
snd_seq_client_ioctl_lock(dp->cseq);
err = snd_seq_kernel_client_ctl(dp->cseq, type, arg);
snd_seq_client_ioctl_unlock(dp->cseq);
return err;
} | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_event.c | static int note_off_event(struct seq_oss_devinfo *dp, int dev, int ch, int note,
int vel, struct snd_seq_event *ev) {
struct seq_oss_synthinfo *info;
info = snd_seq_oss_synth_info(dp, dev);
if (!info)
return -ENXIO;
switch (info->arg.event_passing) {
case SNDRV_SEQ_OSS_PROCESS_... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_init.c | int __init snd_seq_oss_create_client(void) {
int rc;
struct snd_seq_port_info *port;
struct snd_seq_port_callback port_callback;
port = kzalloc(sizeof(*port), GFP_KERNEL);
if (!port) {
rc = -ENOMEM;
goto __error;
}
rc =
snd_seq_create_kernel_client(NULL, SNDRV_SEQ_CLIENT_OSS, "OSS sequence... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_init.c | static int receive_announce(struct snd_seq_event *ev, int direct, void *private,
int atomic, int hop) {
struct snd_seq_port_info pinfo;
if (atomic)
return 0;
switch (ev->type) {
case SNDRV_SEQ_EVENT_PORT_START:
case SNDRV_SEQ_EVENT_PORT_CHANGE:
if (ev->data.addr.client ==... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_init.c | int snd_seq_oss_delete_client(void) {
cancel_work_sync(&async_lookup_work);
if (system_client >= 0)
snd_seq_delete_kernel_client(system_client);
snd_seq_oss_midi_clear_all();
return 0;
} | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_init.c | static int translate_mode(struct file *file) {
int file_mode = 0;
if ((file->f_flags & O_ACCMODE) != O_RDONLY)
file_mode |= SNDRV_SEQ_OSS_FILE_WRITE;
if ((file->f_flags & O_ACCMODE) != O_WRONLY)
file_mode |= SNDRV_SEQ_OSS_FILE_READ;
if (file->f_flags & O_NONBLOCK)
file_mode |= SNDRV_SEQ_OSS_FILE_NON... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_init.c | static int create_port(struct seq_oss_devinfo *dp) {
int rc;
struct snd_seq_port_info port;
struct snd_seq_port_callback callback;
memset(&port, 0, sizeof(port));
port.addr.client = dp->cseq;
sprintf(port.name, "Sequencer-%d", dp->index);
port.capability = SNDRV_SEQ_PORT_CAP_READ | SNDRV_SEQ_PORT_CAP_WRI... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_init.c | static int alloc_seq_queue(struct seq_oss_devinfo *dp) {
struct snd_seq_queue_info qinfo;
int rc;
memset(&qinfo, 0, sizeof(qinfo));
qinfo.owner = system_client;
qinfo.locked = 1;
strcpy(qinfo.name, "OSS Sequencer Emulation");
rc = call_ctl(SNDRV_SEQ_IOCTL_CREATE_QUEUE, &qinfo);
if (rc < 0)
return r... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_init.c | static int delete_seq_queue(int queue) {
struct snd_seq_queue_info qinfo;
int rc;
if (queue < 0)
return 0;
memset(&qinfo, 0, sizeof(qinfo));
qinfo.queue = queue;
rc = call_ctl(SNDRV_SEQ_IOCTL_DELETE_QUEUE, &qinfo);
if (rc < 0)
pr_err("ALSA: seq_oss: unable to delete queue %d (%d)\n", queue, rc);
... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_init.c | void snd_seq_oss_reset(struct seq_oss_devinfo *dp) {
int i;
for (i = 0; i < dp->max_synthdev; i++)
snd_seq_oss_synth_reset(dp, i);
/* reset all midi devices */
if (dp->seq_mode != SNDRV_SEQ_OSS_MODE_MUSIC) {
for (i = 0; i < dp->max_mididev; i++)
snd_seq_oss_midi_reset(dp, i);
}
/* remove qu... | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_init.c | void snd_seq_oss_system_info_read(struct snd_info_buffer *buf) {
int i;
struct seq_oss_devinfo *dp;
snd_iprintf(buf, "ALSA client number %d\n", system_client);
snd_iprintf(buf, "ALSA receiver port %d\n", system_port);
snd_iprintf(buf, "\nNumber of applications: %d\n", num_clients);
for (i = 0; i < num_cli... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_midi.c | int snd_seq_oss_midi_check_exit_port(int client, int port) {
struct seq_oss_midi *mdev;
unsigned long flags;
int index;
mdev = find_slot(client, port);
if (mdev) {
spin_lock_irqsave(®ister_lock, flags);
midi_devs[mdev->seq_device] = NULL;
spin_unlock_irqrestore(®ister_lock, flags);
snd_... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_midi.c | int snd_seq_oss_midi_filemode(struct seq_oss_devinfo *dp, int dev) {
struct seq_oss_midi *mdev;
int mode;
mdev = get_mididev(dp, dev);
if (!mdev)
return 0;
mode = 0;
if (mdev->opened & PERM_WRITE)
mode |= SNDRV_SEQ_OSS_FILE_WRITE;
if (mdev->opened & PERM_READ)
mode |= SNDRV_SEQ_OSS_FILE_READ... | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_midi.c | void snd_seq_oss_midi_reset(struct seq_oss_devinfo *dp, int dev) {
struct seq_oss_midi *mdev;
mdev = get_mididev(dp, dev);
if (!mdev)
return;
if (!mdev->opened) {
snd_use_lock_free(&mdev->use_lock);
return;
}
if (mdev->opened & PERM_WRITE) {
struct snd_seq_event ev;
int c;
memset(... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_midi.c | void snd_seq_oss_midi_get_addr(struct seq_oss_devinfo *dp, int dev,
struct snd_seq_addr *addr) {
struct seq_oss_midi *mdev;
mdev = get_mididev(dp, dev);
if (!mdev)
return;
addr->client = mdev->client;
addr->port = mdev->port;
snd_use_lock_free(&mdev->use_lock);
} | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_midi.c | int snd_seq_oss_midi_make_info(struct seq_oss_devinfo *dp, int dev,
struct midi_info *inf) {
struct seq_oss_midi *mdev;
mdev = get_mididev(dp, dev);
if (!mdev)
return -ENXIO;
inf->device = dev;
inf->dev_type = 0; /* FIXME: ?? */
inf->capabilities = 0; /* FIXME: ?? */
... | [
1,
1
] |
Linux Kernel | sound/core/seq/oss/seq_oss_midi.c | static char *capmode_str(int val) {
val &= PERM_READ | PERM_WRITE;
if (val == (PERM_READ | PERM_WRITE))
return "read/write";
else if (val == PERM_READ)
return "read";
else if (val == PERM_WRITE)
return "write";
else
return "none";
} | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_readq.c | struct seq_oss_readq *snd_seq_oss_readq_new(struct seq_oss_devinfo *dp,
int maxlen) {
struct seq_oss_readq *q;
q = kzalloc(sizeof(*q), GFP_KERNEL);
if (!q)
return NULL;
q->q = kcalloc(maxlen, sizeof(union evrec), GFP_KERNEL);
if (!q->q) {
kfree(q);
ret... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_readq.c | void snd_seq_oss_readq_delete(struct seq_oss_readq *q) {
if (q) {
kfree(q->q);
kfree(q);
}
} | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_readq.c | void snd_seq_oss_readq_clear(struct seq_oss_readq *q) {
if (q->qlen) {
q->qlen = 0;
q->head = q->tail = 0;
}
wake_up(&q->midi_sleep);
q->input_time = (unsigned long)-1;
} | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_readq.c | int snd_seq_oss_readq_puts(struct seq_oss_readq *q, int dev,
unsigned char *data, int len) {
union evrec rec;
int result;
memset(&rec, 0, sizeof(rec));
rec.c[0] = SEQ_MIDIPUTC;
rec.c[2] = dev;
while (len-- > 0) {
rec.c[1] = *data++;
result = snd_seq_oss_readq_put_event(q... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_readq.c |
static int readq_dump_sysex(void *ptr, void *buf, int count) {
struct readq_sysex_ctx *ctx = ptr;
return snd_seq_oss_readq_puts(ctx->readq, ctx->dev, buf, count);
} | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_readq.c |
int snd_seq_oss_readq_sysex(struct seq_oss_readq *q, int dev,
struct snd_seq_event *ev) {
struct readq_sysex_ctx ctx = {.readq = q, .dev = dev};
if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) !=
SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
return 0;
return snd_seq_dump_var_event(ev, rea... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_readq.c | unsigned int snd_seq_oss_readq_poll(struct seq_oss_readq *q, struct file *file,
poll_table *wait) {
poll_wait(file, &q->midi_sleep, wait);
return q->qlen;
} | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_readq.c | int snd_seq_oss_readq_put_timestamp(struct seq_oss_readq *q, unsigned long curt,
int seq_mode) {
if (curt != q->input_time) {
union evrec rec;
memset(&rec, 0, sizeof(rec));
switch (seq_mode) {
case SNDRV_SEQ_OSS_MODE_SYNTH:
rec.echo = (curt << 8) | SEQ_WAIT;
... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_rw.c | int snd_seq_oss_write(struct seq_oss_devinfo *dp, const char __user *buf,
int count, struct file *opt) {
int result = 0, err = 0;
int ev_size, fmt;
union evrec rec;
if (!is_write_mode(dp->file_mode) || dp->writeq == NULL)
return -ENXIO;
while (count >= SHORT_EVENT_SIZE) {
if (c... | [
1,
1
] |
Linux Kernel | sound/core/seq/oss/seq_oss_rw.c | static int insert_queue(struct seq_oss_devinfo *dp, union evrec *rec,
struct file *opt) {
int rc = 0;
struct snd_seq_event event;
if (snd_seq_oss_process_timer_event(dp->timer, rec))
return 0; /* no need to insert queue */
/* parse this event */
memset(&event, 0, sizeof(event));
... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_rw.c | __poll_t snd_seq_oss_poll(struct seq_oss_devinfo *dp, struct file *file,
poll_table *wait) {
__poll_t mask = 0;
if (dp->readq && is_read_mode(dp->file_mode)) {
if (snd_seq_oss_readq_poll(dp->readq, file, wait))
mask |= EPOLLIN | EPOLLRDNORM;
}
/* output */
if (dp->writeq ... | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_synth.c | int snd_seq_oss_synth_probe(struct device *_dev) {
struct snd_seq_device *dev = to_seq_dev(_dev);
int i;
struct seq_oss_synth *rec;
struct snd_seq_oss_reg *reg = SNDRV_SEQ_DEVICE_ARGPTR(dev);
unsigned long flags;
rec = kzalloc(sizeof(*rec), GFP_KERNEL);
if (!rec)
return -ENOMEM;
rec->seq_device = -... | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_synth.c | struct seq_oss_synthinfo *snd_seq_oss_synth_info(struct seq_oss_devinfo *dp,
int dev) {
struct seq_oss_synth *rec;
rec = get_synthdev(dp, dev);
if (rec) {
snd_use_lock_free(&rec->use_lock);
return get_synthinfo_nospec(dp, dev);
}
return NULL;
} | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_synth.c | int snd_seq_oss_synth_sysex(struct seq_oss_devinfo *dp, int dev,
unsigned char *buf, struct snd_seq_event *ev) {
int i, send;
unsigned char *dest;
struct seq_oss_synth_sysex *sysex;
struct seq_oss_synthinfo *info;
info = snd_seq_oss_synth_info(dp, dev);
if (!info)
return -EN... | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_timer.c | static void calc_alsa_tempo(struct seq_oss_timer *timer) {
timer->tempo = (60 * 1000000) / timer->oss_tempo;
timer->ppq = timer->oss_timebase;
} | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_timer.c | int snd_seq_oss_timer_tempo(struct seq_oss_timer *timer, int value) {
if (value < MIN_OSS_TEMPO)
value = MIN_OSS_TEMPO;
else if (value > MAX_OSS_TEMPO)
value = MAX_OSS_TEMPO;
timer->oss_tempo = value;
calc_alsa_tempo(timer);
if (timer->running)
send_timer_event(timer->dp, SNDRV_SEQ_EVENT_TEMPO, ti... | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_timer.h | static inline abstime_t
snd_seq_oss_timer_cur_tick(struct seq_oss_timer *timer) {
return timer->cur_tick;
} | [
0,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_writeq.c | void snd_seq_oss_writeq_clear(struct seq_oss_writeq *q) {
struct snd_seq_remove_events reset;
memset(&reset, 0, sizeof(reset));
reset.remove_mode = SNDRV_SEQ_REMOVE_OUTPUT;
snd_seq_oss_control(q->dp, SNDRV_SEQ_IOCTL_REMOVE_EVENTS, &reset);
/* wake up sleepers if any */
snd_seq_oss_writeq_wakeup(q, 0);
} | [
1,
0
] |
Linux Kernel | sound/core/seq/oss/seq_oss_writeq.c | void snd_seq_oss_writeq_set_output(struct seq_oss_writeq *q, int val) {
struct snd_seq_client_pool pool;
pool.client = q->dp->cseq;
snd_seq_oss_control(q->dp, SNDRV_SEQ_IOCTL_GET_CLIENT_POOL, &pool);
pool.output_room = val;
snd_seq_oss_control(q->dp, SNDRV_SEQ_IOCTL_SET_CLIENT_POOL, &pool);
} | [
0,
0
] |
Linux Kernel | sound/core/seq/seq_clientmgr.c | bool snd_seq_client_ioctl_lock(int clientid) {
struct snd_seq_client *client;
client = snd_seq_client_use_ptr(clientid);
if (!client)
return false;
mutex_lock(&client->ioctl_mutex);
return true;
} | [
0,
0
] |
Linux Kernel | sound/core/seq/seq_clientmgr.c |
static void usage_free(struct snd_seq_usage *res, int num) { res->cur -= num; } | [
0,
0
] |
Linux Kernel | sound/core/seq/seq_clientmgr.c | static struct snd_seq_client *seq_create_client1(int client_index,
int poolsize) {
int c;
struct snd_seq_client *client;
client = kzalloc(sizeof(*client), GFP_KERNEL);
if (client == NULL)
return NULL;
client->pool = snd_seq_pool_new(poolsize);
if (client... | [
0,
0
] |
Linux Kernel | sound/core/seq/seq_clientmgr.c |
static int seq_free_client1(struct snd_seq_client *client) {
if (!client)
return 0;
spin_lock_irq(&clients_lock);
clienttablock[client->number] = 1;
clienttab[client->number] = NULL;
spin_unlock_irq(&clients_lock);
snd_seq_delete_all_ports(client);
snd_seq_queue_client_leave(client->number);
snd_u... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.