Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/usb/pcm.c | static int snd_usb_pcm_playback_ack(struct snd_pcm_substream *substream) {
struct snd_usb_substream *subs = substream->runtime->private_data;
struct snd_usb_endpoint *ep;
if (!subs->lowlatency_playback || !subs->running)
return 0;
ep = subs->data_endpoint;
if (!ep)
return 0;
if (!ep->active_mask)
... | [
1,
0
] |
Linux Kernel | sound/usb/pcm.c |
static int
snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream,
int cmd) {
int err;
struct snd_usb_substream *subs = substream->runtime->private_data;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
err = start_endpoints(subs);
if (err < 0)
return... | [
1,
0
] |
Linux Kernel | sound/usb/power.c |
int snd_usb_power_domain_set(struct snd_usb_audio *chip,
struct snd_usb_power_domain *pd,
unsigned char state) {
struct usb_device *dev = chip->dev;
unsigned char current_state;
int err, idx;
idx = snd_usb_ctrl_intf(chip) | (pd->pd_id << 8);
err = s... | [
1,
0
] |
Linux Kernel | sound/usb/proc.c | static inline unsigned get_full_speed_hz(unsigned int usb_rate) {
return (usb_rate * 125 + (1 << 12)) >> 13;
} | [
0,
0
] |
Linux Kernel | sound/usb/quirks.c | static int
create_composite_quirk(struct snd_usb_audio *chip, struct usb_interface *iface,
struct usb_driver *driver,
const struct snd_usb_audio_quirk *quirk_comp) {
int probed_ifnum = get_iface_desc(iface->altsetting)->bInterfaceNumber;
const struct snd_usb_audio_quirk... | [
1,
0
] |
Linux Kernel | sound/usb/quirks.c | static int create_auto_pcm_quirk(struct snd_usb_audio *chip,
struct usb_interface *iface,
struct usb_driver *driver) {
struct usb_host_interface *alts;
struct usb_interface_descriptor *altsd;
struct usb_endpoint_descriptor *epd;
struct uac1_as_he... | [
1,
0
] |
Linux Kernel | sound/usb/quirks.c | static int create_roland_midi_quirk(struct snd_usb_audio *chip,
struct usb_interface *iface,
struct usb_driver *driver,
struct usb_host_interface *alts) {
static const struct snd_usb_audio_quirk roland_midi_qui... | [
1,
0
] |
Linux Kernel | sound/usb/quirks.c |
static int create_autodetect_quirk(struct snd_usb_audio *chip,
struct usb_interface *iface,
struct usb_driver *driver,
const struct snd_usb_audio_quirk *quirk) {
int err;
err = create_auto_pcm_quirk(chip, ifac... | [
0,
0
] |
Linux Kernel | sound/usb/quirks.c |
static int snd_usb_audigy2nx_boot_quirk(struct usb_device *dev) {
u8 buf = 1;
snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 0x2a,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER, 0, 0, &buf,
1);
if (buf == 0) {
snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), 0x29,
... | [
0,
0
] |
Linux Kernel | sound/usb/quirks.c | static int snd_usb_cm106_write_int_reg(struct usb_device *dev, int reg,
u16 value) {
u8 buf[4];
buf[0] = 0x20;
buf[1] = value & 0xff;
buf[2] = (value >> 8) & 0xff;
buf[3] = reg;
return snd_usb_ctl_msg(
dev, usb_sndctrlpipe(dev, 0), USB_REQ_SET_CONFIGURATION,
... | [
1,
0
] |
Linux Kernel | sound/usb/quirks.c | static void mbox2_setup_48_24_magic(struct usb_device *dev) {
u8 srate[3];
u8 temp[12];
srate[0] = 0x80;
srate[1] = 0xbb;
srate[2] = 0x00;
/* Send the magic! */
snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 0x01, 0x22, 0x0100, 0x0085,
&temp, 0x0003);
snd_usb_ctl_msg(dev, usb_sndctrlp... | [
1,
0
] |
Linux Kernel | sound/usb/quirks.c |
static int snd_usb_motu_microbookii_communicate(struct usb_device *dev, u8 *buf,
int buf_size, int *length) {
int err, actual_length;
if (usb_pipe_type_check(dev, usb_sndintpipe(dev, 0x01)))
return -EINVAL;
err = usb_interrupt_msg(dev, usb_sndintpipe(dev, 0x01... | [
1,
0
] |
Linux Kernel | sound/usb/quirks.c | int snd_usb_apply_interface_quirk(struct snd_usb_audio *chip, int iface,
int altno) {
if (chip->usb_id == USB_ID(0x0763, 0x2003))
return audiophile_skip_setting_quirk(chip, iface, altno);
/* quattro usb: skip altsets incompatible with device_setup */
if (chip->usb_id == USB_... | [
0,
0
] |
Linux Kernel | sound/usb/stream.c | static void free_substream(struct snd_usb_substream *subs) {
struct audioformat *fp, *n;
if (!subs->num_formats)
return;
list_for_each_entry_safe(fp, n, &subs->fmt_list, list) audioformat_free(fp);
kfree(subs->str_pd);
snd_media_stream_delete(subs);
} | [
0,
0
] |
Linux Kernel | sound/usb/stream.c |
int snd_usb_add_audio_stream(struct snd_usb_audio *chip, int stream,
struct audioformat *fp) {
return __snd_usb_add_audio_stream(chip, stream, fp, NULL);
} | [
0,
0
] |
Linux Kernel | sound/usb/stream.c | static void *
snd_usb_find_output_terminal_descriptor(struct usb_host_interface *ctrl_iface,
int terminal_id, int protocol) {
struct uac2_output_terminal_descriptor *term = NULL;
while (
(term = snd_usb_find_csint_desc(ctrl_iface->extra, ctrl_iface->extralen,
... | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/us122l.c |
static int us144_create_usbmidi(struct snd_card *card) {
static const struct snd_usb_midi_endpoint_info quirk_data = {
.out_ep = 4, .in_ep = 3, .out_cables = 0x001, .in_cables = 0x001};
static const struct snd_usb_audio_quirk quirk = {.vendor_name = "US144",
... | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/us122l.c |
static void usb_stream_hwdep_vm_close(struct vm_area_struct *area) {
struct us122l *us122l = area->vm_private_data;
atomic_dec(&us122l->mmap_count);
snd_printdd(KERN_DEBUG "%i\n", atomic_read(&us122l->mmap_count));
} | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/us122l.c | static int usb_stream_hwdep_mmap(struct snd_hwdep *hw, struct file *filp,
struct vm_area_struct *area) {
unsigned long size = area->vm_end - area->vm_start;
struct us122l *us122l = hw->private_data;
unsigned long offset;
struct usb_stream *s;
int err = 0;
bool read;
offse... | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/us122l.c | static bool us122l_start(struct us122l *us122l, unsigned int rate,
unsigned int period_frames) {
struct list_head *p;
int err;
unsigned int use_packsize = 0;
bool success = false;
if (us122l->dev->speed == USB_SPEED_HIGH) {
switch (rate) {
case 44100:
use_packsize = 36... | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/us122l.c |
static int us122l_usb_probe(struct usb_interface *intf,
const struct usb_device_id *device_id,
struct snd_card **cardp) {
struct usb_device *device = interface_to_usbdev(intf);
struct snd_card *card;
int err;
err = usx2y_create_card(device, intf, &card, ... | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usbusx2y.c | int usx2y_async_seq04_init(struct usx2ydev *usx2y) {
int err = 0, i;
if (WARN_ON(usx2y->as04.buffer))
return -EBUSY;
usx2y->as04.buffer =
kmalloc_array(URBS_ASYNC_SEQ, URB_DATA_LEN_ASYNC_SEQ, GFP_KERNEL);
if (!usx2y->as04.buffer) {
err = -ENOMEM;
} else {
for (i = 0; i < URBS_ASYNC_SEQ; ++... | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usbusx2y.c |
static void usx2y_unlinkseq(struct snd_usx2y_async_seq *s) {
int i;
for (i = 0; i < URBS_ASYNC_SEQ; ++i) {
if (!s->urb[i])
continue;
usb_kill_urb(s->urb[i]);
usb_free_urb(s->urb[i]);
s->urb[i] = NULL;
}
kfree(s->buffer);
s->buffer = NULL;
} | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usbusx2y.c |
static void snd_usx2y_card_private_free(struct snd_card *card) {
struct usx2ydev *usx2y = usx2y(card);
kfree(usx2y->in04_buf);
usb_free_urb(usx2y->in04_urb);
if (usx2y->us428ctls_sharedmem)
free_pages_exact(usx2y->us428ctls_sharedmem, US428_SHAREDMEM_PAGES);
if (usx2y->card_index >= 0 && usx2y->card_ind... | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/usbusx2yaudio.c | static int usx2y_urb_submit(struct snd_usx2y_substream *subs, struct urb *urb,
int frame) {
int err;
if (!urb)
return -ENODEV;
urb->start_frame = frame + NRURBS * nr_of_packs();
urb->hcpriv = NULL;
urb->dev = subs->usx2y->dev; /* we need to set this at each time */
err = usb... | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usbusx2yaudio.c |
static void usx2y_urbs_set_complete(struct usx2ydev *usx2y,
void (*complete)(struct urb *)) {
struct snd_usx2y_substream *subs;
struct urb *urb;
int s, u;
for (s = 0; s < 4; s++) {
subs = usx2y->subs[s];
if (subs) {
for (u = 0; u < NRURBS; u++) {
urb =... | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usbusx2yaudio.c |
static void usx2y_subs_startup(struct snd_usx2y_substream *subs) {
struct usx2ydev *usx2y = subs->usx2y;
usx2y->prepare_subs = subs;
subs->urb[0]->start_frame = -1;
wmb();
usx2y_urbs_set_complete(usx2y, i_usx2y_subs_startup);
} | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/usbusx2yaudio.c | static snd_pcm_uframes_t
snd_usx2y_pcm_pointer(struct snd_pcm_substream *substream) {
struct snd_usx2y_substream *subs = substream->runtime->private_data;
return subs->hwptr_done;
} | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/usbusx2yaudio.c | static int snd_usx2y_pcm_trigger(struct snd_pcm_substream *substream, int cmd) {
struct snd_usx2y_substream *subs = substream->runtime->private_data;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
snd_printdd("%s(START)\n", __func__);
if (atomic_read(&subs->state) == STATE_PREPARED &&
atomic_read(&... | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/usbusx2yaudio.c | static int snd_usx2y_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params) {
int err = 0;
unsigned int rate = params_rate(hw_params);
snd_pcm_format_t format = params_format(hw_params);
struct snd_card *card = substream->pstr->pcm->card;
str... | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/usbusx2yaudio.c | static int snd_usx2y_pcm_prepare(struct snd_pcm_substream *substream) {
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_usx2y_substream *subs = runtime->private_data;
struct usx2ydev *usx2y = subs->usx2y;
struct snd_usx2y_substream *capsubs =
subs->usx2y->subs[SNDRV_PCM_STREAM_CAPTURE];
... | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/usbusx2yaudio.c | static void
usx2y_audio_stream_free(struct snd_usx2y_substream **usx2y_substream) {
int stream;
for_each_pcm_streams(stream) {
kfree(usx2y_substream[stream]);
usx2y_substream[stream] = NULL;
}
} | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usb_stream.c | static inline unsigned int get_usb_full_speed_rate(unsigned int rate) {
return ((rate << 13) + 62) / 125;
} | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/usb_stream.c | static inline unsigned int get_usb_high_speed_rate(unsigned int rate) {
return ((rate << 10) + 62) / 125;
} | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/usb_stream.c |
static bool balance_playback(struct usb_stream_kernel *sk, struct urb *urb) {
sk->iso_frame_balance += urb->number_of_packets;
return balance_check(sk, urb);
} | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usb_stream.c |
static bool balance_capture(struct usb_stream_kernel *sk, struct urb *urb) {
sk->iso_frame_balance -= urb->number_of_packets;
return balance_check(sk, urb);
} | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usb_stream.c |
static void i_playback_idle(struct urb *urb) {
struct usb_stream_kernel *sk = urb->context;
if (balance_playback(sk, urb))
stream_idle(sk, sk->i_urb, urb);
} | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usb_stream.c | void usb_stream_stop(struct usb_stream_kernel *sk) {
int u;
if (!sk->s)
return;
for (u = 0; u < USB_STREAM_NURBS; ++u) {
usb_kill_urb(sk->inurb[u]);
usb_kill_urb(sk->outurb[u]);
}
sk->s->state = usb_stream_stopped;
msleep(400);
} | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usX2Yhwdep.c |
static vm_fault_t snd_us428ctls_vm_fault(struct vm_fault *vmf) {
unsigned long offset;
struct page *page;
void *vaddr;
snd_printdd("ENTER, start %lXh, pgoff %ld\n", vmf->vma->vm_start, vmf->pgoff);
offset = vmf->pgoff << PAGE_SHIFT;
vaddr = (char *)((struct usx2ydev *)vmf->vma->vm_private_data)
... | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usX2Yhwdep.c | static int snd_us428ctls_mmap(struct snd_hwdep *hw, struct file *filp,
struct vm_area_struct *area) {
unsigned long size = (unsigned long)(area->vm_end - area->vm_start);
struct usx2ydev *us428 = hw->private_data;
// FIXME this hwdep interface is used twice: fpga download and mmap f... | [
1,
1
] |
Linux Kernel | sound/usb/usx2y/usX2Yhwdep.c | static int snd_usx2y_hwdep_dsp_load(struct snd_hwdep *hw,
struct snd_hwdep_dsp_image *dsp) {
struct usx2ydev *priv = hw->private_data;
struct usb_device *dev = priv->dev;
int lret, err;
char *buf;
snd_printdd("dsp_load %s\n", dsp->name);
buf = memdup_user(dsp->image, ds... | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usX2Yhwdep.c |
int usx2y_hwdep_new(struct snd_card *card, struct usb_device *device) {
int err;
struct snd_hwdep *hw;
struct usx2ydev *us428 = usx2y(card);
err = snd_hwdep_new(card, SND_USX2Y_LOADER_ID, 0, &hw);
if (err < 0)
return err;
hw->iface = SNDRV_HWDEP_IFACE_USX2Y;
hw->private_data = us428;
hw->ops.dsp_... | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/usx2yhwdeppcm.c | static int usx2y_usbpcm_urb_capt_retire(struct snd_usx2y_substream *subs) {
struct urb *urb = subs->completed_urb;
struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime;
int i, lens = 0, hwptr_done = subs->hwptr_done;
struct usx2ydev *usx2y = subs->usx2y;
int head;
if (usx2y->hwdep_pcm_shm->captur... | [
1,
1
] |
Linux Kernel | sound/usb/usx2y/usx2yhwdeppcm.c | static int usx2y_iso_frames_per_buffer(struct snd_pcm_runtime *runtime,
struct usx2ydev *usx2y) {
return (runtime->buffer_size * 1000) / usx2y->rate +
1; // FIXME: so far only correct period_size == 2^x ?
} | [
1,
1
] |
Linux Kernel | sound/usb/usx2y/usx2yhwdeppcm.c |
static void usx2y_usbpcm_urb_capt_iso_advance(struct snd_usx2y_substream *subs,
struct urb *urb) {
struct usb_iso_packet_descriptor *desc;
struct snd_usx2y_hwdep_pcm_shm *shm;
int pack, head;
for (pack = 0; pack < nr_of_packs(); ++pack) {
desc = urb->iso_frame... | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/usx2yhwdeppcm.c |
static void usx2y_hwdep_urb_release(struct urb **urb) {
usb_kill_urb(*urb);
usb_free_urb(*urb);
*urb = NULL;
} | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usx2yhwdeppcm.c | static void usx2y_usbpcm_urbs_release(struct snd_usx2y_substream *subs) {
int i;
snd_printdd("snd_usx2y_urbs_release() %i\n", subs->endpoint);
for (i = 0; i < NRURBS; i++)
usx2y_hwdep_urb_release(subs->urb + i);
} | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usx2yhwdeppcm.c | static void usx2y_usbpcm_subs_startup(struct snd_usx2y_substream *subs) {
struct usx2ydev *usx2y = subs->usx2y;
usx2y->prepare_subs = subs;
subs->urb[0]->start_frame = -1;
smp_wmb();
usx2y_urbs_set_complete(usx2y, i_usx2y_usbpcm_subs_startup);
} | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/usx2yhwdeppcm.c |
static void snd_usx2y_hwdep_pcm_vm_open(struct vm_area_struct *area) {} | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usx2yhwdeppcm.c |
static vm_fault_t snd_usx2y_hwdep_pcm_vm_fault(struct vm_fault *vmf) {
unsigned long offset;
void *vaddr;
offset = vmf->pgoff << PAGE_SHIFT;
vaddr =
(char *)((struct usx2ydev *)vmf->vma->vm_private_data)->hwdep_pcm_shm +
offset;
vmf->page = virt_to_page(vaddr);
get_page(vmf->page);
return 0;... | [
0,
0
] |
Linux Kernel | sound/usb/usx2y/usx2yhwdeppcm.c |
int usx2y_hwdep_pcm_new(struct snd_card *card) {
int err;
struct snd_hwdep *hw;
struct snd_pcm *pcm;
struct usb_device *dev = usx2y(card)->dev;
if (nr_of_packs() != 1)
return 0;
err = snd_hwdep_new(card, SND_USX2Y_USBPCM_ID, 1, &hw);
if (err < 0)
return err;
hw->iface = SNDRV_HWDEP_IFACE_USX... | [
1,
0
] |
Linux Kernel | sound/usb/usx2y/usx2yhwdeppcm.c |
int usx2y_hwdep_pcm_new(struct snd_card *card) { return 0; }
#endif | [
0,
0
] |
Linux Kernel | sound/usb/validate.c | static bool validate_uac1_header(const void *p,
const struct usb_desc_validator *v) {
const struct uac1_ac_header_descriptor *d = p;
return d->bLength >= sizeof(*d) &&
d->bLength >= sizeof(*d) + d->bInCollection;
} | [
1,
0
] |
Linux Kernel | sound/usb/validate.c |
bool snd_usb_validate_midi_desc(void *p) {
unsigned char *c = p;
bool valid;
valid = validate_desc(p, UAC_VERSION_1, midi_validators);
if (!valid && snd_usb_skip_validation) {
print_hex_dump(KERN_ERR, "USB-audio: buggy midi desc: ", DUMP_PREFIX_NONE,
16, 1, c, c[0], true);
valid = t... | [
1,
0
] |
Linux Kernel | sound/virtio/virtio_card.c | static void virtsnd_disable_event_vq(struct virtio_snd *snd) {
struct virtio_snd_queue *queue = virtsnd_event_queue(snd);
struct virtio_snd_event *event;
u32 length;
unsigned long flags;
if (queue->vqueue) {
spin_lock_irqsave(&queue->lock, flags);
virtqueue_disable_cb(queue->vqueue);
while ((even... | [
0,
0
] |
Linux Kernel | sound/virtio/virtio_card.c | static int virtsnd_build_devs(struct virtio_snd *snd) {
struct virtio_device *vdev = snd->vdev;
struct device *dev = &vdev->dev;
int rc;
rc = snd_card_new(dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, THIS_MODULE, 0,
&snd->card);
if (rc < 0)
return rc;
snd->card->private_data = snd;... | [
1,
0
] |
Linux Kernel | sound/virtio/virtio_ctl_msg.c | void *virtsnd_ctl_msg_request(struct virtio_snd_msg *msg) {
return sg_virt(&msg->sg_request);
} | [
0,
0
] |
Linux Kernel | sound/virtio/virtio_ctl_msg.c | void *virtsnd_ctl_msg_response(struct virtio_snd_msg *msg) {
return sg_virt(&msg->sg_response);
} | [
0,
0
] |
Linux Kernel | sound/virtio/virtio_ctl_msg.c | void virtsnd_ctl_notify_cb(struct virtqueue *vqueue) {
struct virtio_snd *snd = vqueue->vdev->priv;
struct virtio_snd_queue *queue = virtsnd_control_queue(snd);
struct virtio_snd_msg *msg;
u32 length;
unsigned long flags;
spin_lock_irqsave(&queue->lock, flags);
do {
virtqueue_disable_cb(vqueue);
... | [
1,
0
] |
Linux Kernel | sound/virtio/virtio_ctl_msg.h | static inline int virtsnd_ctl_msg_send_sync(struct virtio_snd *snd,
struct virtio_snd_msg *msg) {
return virtsnd_ctl_msg_send(snd, msg, NULL, NULL, false);
} | [
0,
0
] |
Linux Kernel | sound/virtio/virtio_jack.c | static int virtsnd_jack_get_type(struct virtio_jack *vjack) {
unsigned int defconf = vjack->defconf;
unsigned int device = (defconf & AC_DEFCFG_DEVICE) >> AC_DEFCFG_DEVICE_SHIFT;
switch (device) {
case AC_JACK_LINE_OUT:
case AC_JACK_SPEAKER:
return SND_JACK_LINEOUT;
case AC_JACK_HP_OUT:
return SND_... | [
1,
0
] |
Linux Kernel | sound/virtio/virtio_pcm.c | struct virtio_pcm *virtsnd_pcm_find_or_create(struct virtio_snd *snd, u32 nid) {
struct virtio_device *vdev = snd->vdev;
struct virtio_pcm *vpcm;
vpcm = virtsnd_pcm_find(snd, nid);
if (!IS_ERR(vpcm))
return vpcm;
vpcm = devm_kzalloc(&vdev->dev, sizeof(*vpcm), GFP_KERNEL);
if (!vpcm)
return ERR_PTR... | [
1,
0
] |
Linux Kernel | sound/virtio/virtio_pcm.c | void virtsnd_pcm_event(struct virtio_snd *snd, struct virtio_snd_event *event) {
struct virtio_pcm_substream *vss;
u32 sid = le32_to_cpu(event->data);
if (sid >= snd->nsubstreams)
return;
vss = &snd->substreams[sid];
switch (le32_to_cpu(event->hdr.code)) {
case VIRTIO_SND_EVT_PCM_PERIOD_ELAPSED:
... | [
1,
1
] |
Linux Kernel | sound/virtio/virtio_pcm_msg.c | static int virtsnd_pcm_sg_num(u8 *data, unsigned int length) {
phys_addr_t sg_address;
unsigned int sg_length;
int num = 0;
while (length) {
struct page *pg = vmalloc_to_page(data);
phys_addr_t pg_address = page_to_phys(pg);
size_t pg_length;
pg_length = PAGE_SIZE - offset_in_page(data);
i... | [
1,
0
] |
Linux Kernel | sound/virtio/virtio_pcm_msg.c | int virtsnd_pcm_msg_alloc(struct virtio_pcm_substream *vss,
unsigned int periods, unsigned int period_bytes) {
struct snd_pcm_runtime *runtime = vss->substream->runtime;
unsigned int i;
vss->msgs = kcalloc(periods, sizeof(*vss->msgs), GFP_KERNEL);
if (!vss->msgs)
return -ENOMEM;
... | [
1,
0
] |
Linux Kernel | sound/virtio/virtio_pcm_msg.c | void virtsnd_pcm_msg_free(struct virtio_pcm_substream *vss) {
unsigned int i;
for (i = 0; vss->msgs && i < vss->nmsgs; ++i)
kfree(vss->msgs[i]);
kfree(vss->msgs);
vss->msgs = NULL;
vss->nmsgs = 0;
} | [
1,
0
] |
Linux Kernel | sound/virtio/virtio_pcm_msg.c | int virtsnd_pcm_msg_send(struct virtio_pcm_substream *vss) {
struct snd_pcm_runtime *runtime = vss->substream->runtime;
struct virtio_snd *snd = vss->snd;
struct virtio_device *vdev = snd->vdev;
struct virtqueue *vqueue = virtsnd_pcm_queue(vss)->vqueue;
int i;
int n;
bool notify = false;
i = (vss->msg_... | [
1,
0
] |
Linux Kernel | sound/virtio/virtio_pcm_msg.c | static void virtsnd_pcm_msg_complete(struct virtio_pcm_msg *msg,
size_t written_bytes) {
struct virtio_pcm_substream *vss = msg->substream;
spin_lock(&vss->lock);
/*
* If the capture substream returned an incorrect status, then just
* increase the hw_ptr by the message ... | [
1,
0
] |
Linux Kernel | sound/virtio/virtio_pcm_msg.c | struct virtio_snd_msg *
virtsnd_pcm_ctl_msg_alloc(struct virtio_pcm_substream *vss,
unsigned int command, gfp_t gfp) {
size_t request_size = sizeof(struct virtio_snd_pcm_hdr);
size_t response_size = sizeof(struct virtio_snd_hdr);
struct virtio_snd_msg *msg;
switch (command) {
case V... | [
1,
0
] |
Linux Kernel | sound/virtio/virtio_pcm_ops.c | static int virtsnd_pcm_sync_stop(struct snd_pcm_substream *substream) {
struct virtio_pcm_substream *vss = snd_pcm_substream_chip(substream);
struct virtio_snd *snd = vss->snd;
struct virtio_snd_msg *msg;
unsigned int js = msecs_to_jiffies(virtsnd_msg_timeout_ms);
int rc;
cancel_work_sync(&vss->elapsed_per... | [
1,
0
] |
Linux Kernel | sound/x86/intel_hdmi_audio.c | static int had_init_audio_ctrl(struct snd_pcm_substream *substream,
struct snd_intelhad *intelhaddata) {
union aud_cfg cfg_val = {.regval = 0};
union aud_buf_config buf_cfg = {.regval = 0};
u8 channels;
had_prog_status_reg(substream, intelhaddata);
buf_cfg.regx.audio_fifo_wate... | [
1,
0
] |
Linux Kernel | sound/x86/intel_hdmi_audio.c | static int had_chmap_ctl_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = HAD_MAX_CHANNEL;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = SNDRV_CHMAP_LAST;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/x86/intel_hdmi_audio.c | static void had_prog_bd(struct snd_pcm_substream *substream,
struct snd_intelhad *intelhaddata) {
int idx = intelhaddata->bd_head;
int ofs = intelhaddata->pcmbuf_filled * intelhaddata->period_bytes;
u32 addr = substream->runtime->dma_addr + ofs;
addr |= AUD_BUF_VALID;
if (!substream->... | [
1,
0
] |
Linux Kernel | sound/x86/intel_hdmi_audio.c | static void had_process_buffer_done(struct snd_intelhad *intelhaddata) {
struct snd_pcm_substream *substream;
substream = had_substream_get(intelhaddata);
if (!substream)
return;
if (!intelhaddata->connected) {
snd_pcm_stop_xrun(substream);
goto out; /* disconnected? - bail out */
}
/* proces... | [
0,
0
] |
Linux Kernel | sound/x86/intel_hdmi_audio.c | static int had_pcm_sync_stop(struct snd_pcm_substream *substream) {
struct snd_intelhad *intelhaddata = snd_pcm_substream_chip(substream);
if (!intelhaddata->connected)
return 0;
had_reset_audio(intelhaddata);
wait_clear_underrun_bit(intelhaddata);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/x86/intel_hdmi_audio.c | static int had_iec958_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/x86/intel_hdmi_audio.c | static irqreturn_t display_pipe_interrupt_handler(int irq, void *dev_id) {
struct snd_intelhad_card *card_ctx = dev_id;
u32 audio_stat[3] = {};
int pipe, port;
for_each_pipe(card_ctx, pipe) {
audio_stat[pipe] = had_read_register_raw(card_ctx, pipe, AUD_HDMI_STATUS) &
(HDMI_AUDIO_UND... | [
0,
0
] |
Linux Kernel | sound/x86/intel_hdmi_audio.c | static void notify_audio_lpe(struct platform_device *pdev, int port) {
struct snd_intelhad_card *card_ctx = platform_get_drvdata(pdev);
struct snd_intelhad *ctx;
ctx = &card_ctx->pcm_ctx[single_port ? 0 : port];
if (single_port)
ctx->port = port;
schedule_work(&ctx->hdmi_audio_wq);
} | [
0,
0
] |
Linux Kernel | sound/x86/intel_hdmi_audio.c | static void had_audio_wq(struct work_struct *work) {
struct snd_intelhad *ctx =
container_of(work, struct snd_intelhad, hdmi_audio_wq);
struct intel_hdmi_lpe_audio_pdata *pdata = ctx->dev->platform_data;
struct intel_hdmi_lpe_audio_port_pdata *ppdata = &pdata->port[ctx->port];
int ret;
ret = pm_runtime... | [
1,
0
] |
Linux Kernel | sound/xen/xen_snd_front.c |
static struct xensnd_req *
be_stream_prepare_req(struct xen_snd_front_evtchnl *evtchnl, u8 operation) {
struct xensnd_req *req;
req =
RING_GET_REQUEST(&evtchnl->u.req.ring, evtchnl->u.req.ring.req_prod_pvt);
req->operation = operation;
req->id = evtchnl->evt_next_id++;
evtchnl->evt_id = req->id;
ret... | [
1,
0
] |
Linux Kernel | sound/xen/xen_snd_front.c |
int xen_snd_front_stream_prepare(struct xen_snd_front_evtchnl *evtchnl,
struct xen_front_pgdir_shbuf *shbuf, u8 format,
unsigned int channels, unsigned int rate,
u32 buffer_sz, u32 period_sz) {
struct xensnd_req *req;
... | [
0,
0
] |
Linux Kernel | sound/xen/xen_snd_front.c |
int xen_snd_front_stream_write(struct xen_snd_front_evtchnl *evtchnl,
unsigned long pos, unsigned long count) {
struct xensnd_req *req;
int ret;
mutex_lock(&evtchnl->u.req.req_io_lock);
mutex_lock(&evtchnl->ring_io_lock);
req = be_stream_prepare_req(evtchnl, XENSND_OP_WRITE);... | [
0,
0
] |
Linux Kernel | sound/xen/xen_snd_front.c |
int xen_snd_front_stream_trigger(struct xen_snd_front_evtchnl *evtchnl,
int type) {
struct xensnd_req *req;
int ret;
mutex_lock(&evtchnl->u.req.req_io_lock);
mutex_lock(&evtchnl->ring_io_lock);
req = be_stream_prepare_req(evtchnl, XENSND_OP_TRIGGER);
req->op.trigger.type ... | [
0,
0
] |
Linux Kernel | sound/xen/xen_snd_front.c |
static void __exit xen_drv_fini(void) {
pr_info("Unregistering Xen " XENSND_DRIVER_NAME " frontend driver\n");
xenbus_unregister_driver(&xen_driver);
} | [
0,
0
] |
Linux Kernel | sound/xen/xen_snd_front_alsa.c |
static u64 to_sndif_formats_mask(u64 alsa_formats) {
u64 mask;
int i;
mask = 0;
for (i = 0; i < ARRAY_SIZE(ALSA_SNDIF_FORMATS); i++)
if (pcm_format_to_bits(ALSA_SNDIF_FORMATS[i].alsa) & alsa_formats)
mask |= BIT_ULL(ALSA_SNDIF_FORMATS[i].sndif);
return mask;
} | [
0,
0
] |
Linux Kernel | sound/xen/xen_snd_front_alsa.c |
static void stream_clear(struct xen_snd_front_pcm_stream_info *stream) {
stream->is_open = false;
stream->be_cur_frame = 0;
stream->out_frames = 0;
atomic_set(&stream->hw_ptr, 0);
xen_snd_front_evtchnl_pair_clear(stream->evt_pair);
memset(&stream->shbuf, 0, sizeof(stream->shbuf));
stream->buffer = NULL;
... | [
1,
0
] |
Linux Kernel | sound/xen/xen_snd_front_alsa.c |
static int alsa_pb_copy_user(struct snd_pcm_substream *substream, int channel,
unsigned long pos, void __user *src,
unsigned long count) {
struct xen_snd_front_pcm_stream_info *stream = stream_get(substream);
if (unlikely(pos + count > stream->buffer_sz))
... | [
0,
0
] |
Linux Kernel | sound/xen/xen_snd_front_alsa.c |
int xen_snd_front_alsa_init(struct xen_snd_front_info *front_info) {
struct device *dev = &front_info->xb_dev->dev;
struct xen_front_cfg_card *cfg = &front_info->cfg;
struct xen_snd_front_card_info *card_info;
struct snd_card *card;
int ret, i;
dev_dbg(dev, "Creating virtual sound card\n");
ret = snd_c... | [
1,
0
] |
Linux Kernel | sound/xen/xen_snd_front_cfg.c |
static void cfg_formats(char *list, unsigned int len, const char *path,
struct snd_pcm_hardware *pcm_hw) {
u64 formats;
char *cur_format;
int i;
formats = 0;
while ((cur_format = strsep(&list, XENSND_LIST_SEPARATOR))) {
for (i = 0; i < ARRAY_SIZE(CFG_HW_SUPPORTED_FORMATS); i++)
... | [
0,
0
] |
Linux Kernel | sound/xen/xen_snd_front_cfg.c | static void cfg_read_pcm_hw(const char *path,
struct snd_pcm_hardware *parent_pcm_hw,
struct snd_pcm_hardware *pcm_hw) {
char *list;
int val;
size_t buf_sz;
unsigned int len;
if (parent_pcm_hw)
*pcm_hw = *parent_pcm_hw;
else
*pcm_hw = SND_DRV_... | [
1,
0
] |
Linux Kernel | sound/xen/xen_snd_front_evtchnl.c |
void xen_snd_front_evtchnl_flush(struct xen_snd_front_evtchnl *channel) {
int notify;
channel->u.req.ring.req_prod_pvt++;
RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&channel->u.req.ring, notify);
if (notify)
notify_remote_via_irq(channel->irq);
} | [
0,
0
] |
Linux Kernel | sound/xen/xen_snd_front_evtchnl.c | static void evtchnl_free(struct xen_snd_front_info *front_info,
struct xen_snd_front_evtchnl *channel) {
void *page = NULL;
if (channel->type == EVTCHNL_TYPE_REQ)
page = channel->u.req.ring.sring;
else if (channel->type == EVTCHNL_TYPE_EVT)
page = channel->u.evt.page;
if (!pag... | [
1,
0
] |
Linux Kernel | sound/xen/xen_snd_front_evtchnl.c |
void xen_snd_front_evtchnl_free_all(struct xen_snd_front_info *front_info) {
int i;
if (!front_info->evt_pairs)
return;
for (i = 0; i < front_info->num_evt_pairs; i++) {
evtchnl_free(front_info, &front_info->evt_pairs[i].req);
evtchnl_free(front_info, &front_info->evt_pairs[i].evt);
}
kfree(fr... | [
0,
0
] |
Linux Kernel | tools/accounting/getdelays.c | static int get_family_id(int sd) {
struct {
struct nlmsghdr n;
struct genlmsghdr g;
char buf[256];
} ans;
int id = 0, rc;
struct nlattr *na;
int rep_len;
strcpy(name, TASKSTATS_GENL_NAME);
rc = send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY,
CTRL_ATTR_FAMILY_NAME, (v... | [
1,
0
] |
Linux Kernel | tools/accounting/getdelays.c |
static void print_cgroupstats(struct cgroupstats *c) {
printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, "
"uninterruptible %llu\n",
(unsigned long long)c->nr_sleeping, (unsigned long long)c->nr_io_wait,
(unsigned long long)c->nr_running, (unsigned long long)c->nr_stopped,
... | [
0,
0
] |
Linux Kernel | tools/accounting/procacct.c | static int get_family_id(int sd) {
struct {
struct nlmsghdr n;
struct genlmsghdr g;
char buf[256];
} ans;
int id = 0, rc;
struct nlattr *na;
int rep_len;
strcpy(name, TASKSTATS_GENL_NAME);
rc = send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY,
CTRL_ATTR_FAMILY_NAME, (v... | [
1,
0
] |
Linux Kernel | tools/accounting/procacct.c | static void print_procacct(struct taskstats *t) {
printf("%c pid=%lu tgid=%lu uid=%lu wall=%llu gwall=%llu cpu=%llu "
"vmpeak=%llu rsspeak=%llu dev=%lu:%lu inode=%llu comm=%s\n",
t->version >= 12 ? (t->ac_flag & AGROUP ? 'P' : 'T') : '?',
(unsigned long)t->ac_pid,
(unsigned long)(... | [
1,
0
] |
Linux Kernel | tools/arch/arm64/include/asm/cputype.h |
static inline bool is_midr_in_range(u32 midr, struct midr_range const *range) {
return midr_is_cpu_model_range(midr, range->model, range->rv_min,
range->rv_max);
} | [
0,
0
] |
Linux Kernel | tools/arch/arm64/include/asm/cputype.h |
static inline u64 __attribute_const__ read_cpuid_mpidr(void) {
return read_cpuid(MPIDR_EL1);
} | [
0,
0
] |
Linux Kernel | tools/arch/arm64/include/asm/cputype.h |
static inline u32 __attribute_const__ read_cpuid_cachetype(void) {
return read_cpuid(CTR_EL0);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.