Lines Matching defs:msg

147 		struct virtio_pcm_msg *msg;
149 msg = kzalloc(struct_size(msg, sgs, sg_num + 2), GFP_KERNEL);
150 if (!msg)
153 msg->substream = vss;
154 sg_init_one(&msg->sgs[PCM_MSG_SG_XFER], &msg->xfer,
155 sizeof(msg->xfer));
156 sg_init_one(&msg->sgs[PCM_MSG_SG_STATUS], &msg->status,
157 sizeof(msg->status));
158 virtsnd_pcm_sg_from(&msg->sgs[PCM_MSG_SG_DATA], sg_num, data,
161 vss->msgs[i] = msg;
216 struct virtio_pcm_msg *msg = vss->msgs[i];
218 &msg->sgs[PCM_MSG_SG_XFER],
219 &msg->sgs[PCM_MSG_SG_DATA],
220 &msg->sgs[PCM_MSG_SG_STATUS]
228 msg->length += n;
229 if (msg->length == period_bytes) {
230 msg->xfer.stream_id = cpu_to_le32(vss->sid);
231 memset(&msg->status, 0, sizeof(msg->status));
234 rc = virtqueue_add_sgs(vqueue, psgs, 2, 1, msg,
237 rc = virtqueue_add_sgs(vqueue, psgs, 1, 2, msg,
281 * @msg: I/O message.
288 * For the playback substream, @written_bytes is equal to sizeof(msg->status).
290 * For the capture substream, @written_bytes is equal to sizeof(msg->status)
295 static void virtsnd_pcm_msg_complete(struct virtio_pcm_msg *msg,
298 struct virtio_pcm_substream *vss = msg->substream;
311 written_bytes <= sizeof(msg->status))
312 vss->hw_ptr += msg->length;
314 vss->hw_ptr += written_bytes - sizeof(msg->status);
319 msg->length = 0;
329 le32_to_cpu(msg->status.latency_bytes));
345 struct virtio_pcm_msg *msg;
351 while ((msg = virtqueue_get_buf(queue->vqueue, &written_bytes)))
352 virtsnd_pcm_msg_complete(msg, written_bytes);
398 struct virtio_snd_msg *msg;
406 msg = virtsnd_ctl_msg_alloc(request_size, response_size, gfp);
407 if (msg) {
408 struct virtio_snd_pcm_hdr *hdr = virtsnd_ctl_msg_request(msg);
414 return msg;