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 msg->length = period_bytes; in virtsnd_pcm_msg_alloc()
159 virtsnd_pcm_sg_from(&msg->sgs[PCM_MSG_SG_DATA], sg_num, data, in virtsnd_pcm_msg_alloc()
162 vss->msgs[i] = msg; in virtsnd_pcm_msg_alloc()
215 struct virtio_pcm_msg *msg = vss->msgs[i]; in virtsnd_pcm_msg_send() local
217 &msg->sgs[PCM_MSG_SG_XFER], in virtsnd_pcm_msg_send()
218 &msg->sgs[PCM_MSG_SG_DATA], in virtsnd_pcm_msg_send()
219 &msg->sgs[PCM_MSG_SG_STATUS] in virtsnd_pcm_msg_send()
223 msg->xfer.stream_id = cpu_to_le32(vss->sid); in virtsnd_pcm_msg_send()
224 memset(&msg->status, 0, sizeof(msg->status)); in virtsnd_pcm_msg_send()
227 rc = virtqueue_add_sgs(vqueue, psgs, 2, 1, msg, in virtsnd_pcm_msg_send()
230 rc = virtqueue_add_sgs(vqueue, psgs, 1, 2, msg, in virtsnd_pcm_msg_send()
288 static void virtsnd_pcm_msg_complete(struct virtio_pcm_msg *msg, in virtsnd_pcm_msg_complete() argument
291 struct virtio_pcm_substream *vss = msg->substream; in virtsnd_pcm_msg_complete()
304 written_bytes <= sizeof(msg->status)) in virtsnd_pcm_msg_complete()
305 vss->hw_ptr += msg->length; in virtsnd_pcm_msg_complete()
307 vss->hw_ptr += written_bytes - sizeof(msg->status); in virtsnd_pcm_msg_complete()
320 le32_to_cpu(msg->status.latency_bytes)); in virtsnd_pcm_msg_complete()
339 struct virtio_pcm_msg *msg; in virtsnd_pcm_notify_cb() local
346 while ((msg = virtqueue_get_buf(queue->vqueue, &written_bytes))) in virtsnd_pcm_notify_cb()
347 virtsnd_pcm_msg_complete(msg, written_bytes); in virtsnd_pcm_notify_cb()
396 struct virtio_snd_msg *msg; in virtsnd_pcm_ctl_msg_alloc() local
404 msg = virtsnd_ctl_msg_alloc(request_size, response_size, gfp); in virtsnd_pcm_ctl_msg_alloc()
405 if (msg) { in virtsnd_pcm_ctl_msg_alloc()
406 struct virtio_snd_pcm_hdr *hdr = virtsnd_ctl_msg_request(msg); in virtsnd_pcm_ctl_msg_alloc()
412 return msg; in virtsnd_pcm_ctl_msg_alloc()