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