Lines Matching defs:vss

122  * @vss: VirtIO PCM substream.
132 int virtsnd_pcm_msg_alloc(struct virtio_pcm_substream *vss,
135 struct snd_pcm_runtime *runtime = vss->substream->runtime;
138 vss->msgs = kcalloc(periods, sizeof(*vss->msgs), GFP_KERNEL);
139 if (!vss->msgs)
142 vss->nmsgs = periods;
153 msg->substream = vss;
161 vss->msgs[i] = msg;
169 * @vss: VirtIO PCM substream.
173 void virtsnd_pcm_msg_free(struct virtio_pcm_substream *vss)
177 for (i = 0; vss->msgs && i < vss->nmsgs; ++i)
178 kfree(vss->msgs[i]);
179 kfree(vss->msgs);
181 vss->msgs = NULL;
182 vss->nmsgs = 0;
187 * @vss: VirtIO PCM substream.
200 int virtsnd_pcm_msg_send(struct virtio_pcm_substream *vss, unsigned long offset,
203 struct virtio_snd *snd = vss->snd;
205 struct virtqueue *vqueue = virtsnd_pcm_queue(vss)->vqueue;
206 unsigned long period_bytes = snd_pcm_lib_period_bytes(vss->substream);
208 unsigned int msg_count = vss->msg_count;
216 struct virtio_pcm_msg *msg = vss->msgs[i];
230 msg->xfer.stream_id = cpu_to_le32(vss->sid);
233 if (vss->direction == SNDRV_PCM_STREAM_PLAYBACK)
243 vss->sid);
247 vss->msg_count++;
254 if (msg_count == vss->msg_count)
257 if (!(vss->features & (1U << VIRTIO_SND_PCM_F_MSG_POLLING)))
268 * @vss: VirtIO substream.
273 unsigned int virtsnd_pcm_msg_pending_num(struct virtio_pcm_substream *vss)
275 guard(spinlock_irqsave)(&vss->lock);
276 return vss->msg_count;
298 struct virtio_pcm_substream *vss = msg->substream;
305 guard(spinlock)(&vss->lock);
310 if (vss->direction == SNDRV_PCM_STREAM_PLAYBACK ||
312 vss->hw_ptr += msg->length;
314 vss->hw_ptr += written_bytes - sizeof(msg->status);
316 if (vss->hw_ptr >= vss->buffer_bytes)
317 vss->hw_ptr -= vss->buffer_bytes;
321 vss->xfer_xrun = false;
322 vss->msg_count--;
324 if (vss->xfer_enabled) {
325 struct snd_pcm_runtime *runtime = vss->substream->runtime;
331 schedule_work(&vss->elapsed_period);
332 } else if (!vss->msg_count) {
333 wake_up_all(&vss->msg_empty);
385 * @vss: VirtIO PCM substream.
393 virtsnd_pcm_ctl_msg_alloc(struct virtio_pcm_substream *vss,
411 hdr->stream_id = cpu_to_le32(vss->sid);