rpmsg: let rpmsg_virtio_get_tx_buffer() always return idx in host side

In rpmsg host side, the tx buffer index is not assigned when this buffer
is obtained from the reclaimer list, this commit let
rpmsg_virtio_get_tx_buffer() always get correct idx.

Note: the idx in rpmsg host side is not used, so this commit is just
an improvement and not fix any issue.

Signed-off-by: Guiding Li <liguiding1@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
Guiding Li
2023-11-22 11:28:33 +01:00
committed by Arnaud Pouliquen
parent cce796dff4
commit 79b1a2cbe4
+2 -3
View File
@@ -180,16 +180,15 @@ static void *rpmsg_virtio_get_tx_buffer(struct rpmsg_virtio_device *rvdev,
r_desc = metal_container_of(node, struct vbuff_reclaimer_t, node);
metal_list_del(node);
data = r_desc;
*idx = r_desc->idx;
#ifndef VIRTIO_DEVICE_ONLY
if (role == RPMSG_HOST)
*len = rvdev->config.h2r_buf_size;
#endif /*!VIRTIO_DEVICE_ONLY*/
#ifndef VIRTIO_DRIVER_ONLY
if (role == RPMSG_REMOTE) {
*idx = r_desc->idx;
if (role == RPMSG_REMOTE)
*len = virtqueue_get_buffer_length(rvdev->svq, *idx);
}
#endif /*!VIRTIO_DRIVER_ONLY*/
#ifndef VIRTIO_DEVICE_ONLY
} else if (role == RPMSG_HOST) {