Lines Matching refs:msg

147 		struct virtio_pcm_msg *msg;  in virtsnd_pcm_msg_alloc()  local
149 msg = kzalloc(struct_size(msg, sgs, sg_num + 2), GFP_KERNEL); in virtsnd_pcm_msg_alloc()
150 if (!msg) in virtsnd_pcm_msg_alloc()
153 msg->substream = vss; in virtsnd_pcm_msg_alloc()
154 sg_init_one(&msg->sgs[PCM_MSG_SG_XFER], &msg->xfer, in virtsnd_pcm_msg_alloc()
155 sizeof(msg->xfer)); in virtsnd_pcm_msg_alloc()
156 sg_init_one(&msg->sgs[PCM_MSG_SG_STATUS], &msg->status, in virtsnd_pcm_msg_alloc()
157 sizeof(msg->status)); in virtsnd_pcm_msg_alloc()
158 virtsnd_pcm_sg_from(&msg->sgs[PCM_MSG_SG_DATA], sg_num, data, in virtsnd_pcm_msg_alloc()
161 vss->msgs[i] = msg; in virtsnd_pcm_msg_alloc()
216 struct virtio_pcm_msg *msg = vss->msgs[i]; in virtsnd_pcm_msg_send() local
218 &msg->sgs[PCM_MSG_SG_XFER], in virtsnd_pcm_msg_send()
219 &msg->sgs[PCM_MSG_SG_DATA], in virtsnd_pcm_msg_send()
220 &msg->sgs[PCM_MSG_SG_STATUS] in virtsnd_pcm_msg_send()
228 msg->length += n; in virtsnd_pcm_msg_send()
229 if (msg->length == period_bytes) { in virtsnd_pcm_msg_send()
230 msg->xfer.stream_id = cpu_to_le32(vss->sid); in virtsnd_pcm_msg_send()
231 memset(&msg->status, 0, sizeof(msg->status)); in virtsnd_pcm_msg_send()
234 rc = virtqueue_add_sgs(vqueue, psgs, 2, 1, msg, in virtsnd_pcm_msg_send()
237 rc = virtqueue_add_sgs(vqueue, psgs, 1, 2, msg, in virtsnd_pcm_msg_send()
301 static void virtsnd_pcm_msg_complete(struct virtio_pcm_msg *msg, in virtsnd_pcm_msg_complete() argument
304 struct virtio_pcm_substream *vss = msg->substream; in virtsnd_pcm_msg_complete()
317 written_bytes <= sizeof(msg->status)) in virtsnd_pcm_msg_complete()
318 vss->hw_ptr += msg->length; in virtsnd_pcm_msg_complete()
320 vss->hw_ptr += written_bytes - sizeof(msg->status); in virtsnd_pcm_msg_complete()
325 msg->length = 0; in virtsnd_pcm_msg_complete()
335 le32_to_cpu(msg->status.latency_bytes)); in virtsnd_pcm_msg_complete()
352 struct virtio_pcm_msg *msg; in virtsnd_pcm_notify_cb() local
359 while ((msg = virtqueue_get_buf(queue->vqueue, &written_bytes))) in virtsnd_pcm_notify_cb()
360 virtsnd_pcm_msg_complete(msg, written_bytes); in virtsnd_pcm_notify_cb()
407 struct virtio_snd_msg *msg; in virtsnd_pcm_ctl_msg_alloc() local
415 msg = virtsnd_ctl_msg_alloc(request_size, response_size, gfp); in virtsnd_pcm_ctl_msg_alloc()
416 if (msg) { in virtsnd_pcm_ctl_msg_alloc()
417 struct virtio_snd_pcm_hdr *hdr = virtsnd_ctl_msg_request(msg); in virtsnd_pcm_ctl_msg_alloc()
423 return msg; in virtsnd_pcm_ctl_msg_alloc()