summaryrefslogtreecommitdiff
path: root/drivers/rpmsg/rpmsg_char.c
diff options
context:
space:
mode:
authorArnaud Pouliquen <arnaud.pouliquen@foss.st.com>2021-03-11 17:04:11 +0300
committerBjorn Andersson <bjorn.andersson@linaro.org>2021-03-17 22:16:36 +0300
commitb4ce7e2ebcc52ff907c5a922bf19c3dfa39dddb1 (patch)
treee98843f646f5c09539eaf9c989118e15e06c7469 /drivers/rpmsg/rpmsg_char.c
parent809328b40cfb152f75541aa3dcbbe4903098963b (diff)
downloadlinux-b4ce7e2ebcc52ff907c5a922bf19c3dfa39dddb1.tar.xz
rpmsg: char: Use rpmsg_sendto to specify the message destination address
When the endpoint device is created by the application, a destination address is specified in the rpmsg_channel_info structure. Since the rpmsg_endpoint structure does not store the destination address, this destination address must be specified when sending a message. Replaces rpmsg_send with rpmsg_sendto to allow to specify the destination address. This implementation is requested for compatibly with some rpmsg backends like the virtio backend. For this, the GLINK an SMD drivers have been updated to support the rpmsg_sendto, even if the destination address is ignored for these backends. For these drivers, the rpmsg_send and rpmsg_trysend ops are preserved to avoid breaking the legacy. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20210311140413.31725-5-arnaud.pouliquen@foss.st.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/rpmsg/rpmsg_char.c')
-rw-r--r--drivers/rpmsg/rpmsg_char.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c
index 9e33b53bbf56..95a65f7a9d8d 100644
--- a/drivers/rpmsg/rpmsg_char.c
+++ b/drivers/rpmsg/rpmsg_char.c
@@ -239,9 +239,9 @@ static ssize_t rpmsg_eptdev_write_iter(struct kiocb *iocb,
}
if (filp->f_flags & O_NONBLOCK)
- ret = rpmsg_trysend(eptdev->ept, kbuf, len);
+ ret = rpmsg_trysendto(eptdev->ept, kbuf, len, eptdev->chinfo.dst);
else
- ret = rpmsg_send(eptdev->ept, kbuf, len);
+ ret = rpmsg_sendto(eptdev->ept, kbuf, len, eptdev->chinfo.dst);
unlock_eptdev:
mutex_unlock(&eptdev->ept_lock);