All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: ohad@wizery.com, bjorn.andersson@linaro.org,
	guennadi.liakhovetski@linux.intel.com
Cc: loic.pallardy@st.com, linux-remoteproc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 03/10] rpmsg: virtio: Add rpmsg channel device ops
Date: Mon, 21 Sep 2020 18:09:53 -0600	[thread overview]
Message-ID: <20200922001000.899956-4-mathieu.poirier@linaro.org> (raw)
In-Reply-To: <20200922001000.899956-1-mathieu.poirier@linaro.org>

From: Arnaud Pouliquen <arnaud.pouliquen@st.com>

Implement the create and release of the RPMsg channel
for the RPMsg virtio bus.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
[Moved function declaration above struct virtio_rpmsg_ops]
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 drivers/rpmsg/virtio_rpmsg_bus.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index e8d55c8b9cbf..e87cf0b79542 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -181,6 +181,9 @@ static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data,
 				  int len, u32 dst);
 static int virtio_rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src,
 					   u32 dst, void *data, int len);
+static struct rpmsg_device *
+__rpmsg_create_channel(struct virtproc_info *vrp,
+		       struct rpmsg_channel_info *chinfo);
 
 static const struct rpmsg_endpoint_ops virtio_endpoint_ops = {
 	.destroy_ept = virtio_rpmsg_destroy_ept,
@@ -285,6 +288,25 @@ static struct rpmsg_endpoint *__rpmsg_create_ept(struct virtproc_info *vrp,
 	return NULL;
 }
 
+static struct rpmsg_device *
+virtio_rpmsg_create_channel(struct rpmsg_device *rpdev,
+			    struct rpmsg_channel_info *chinfo)
+{
+	struct virtio_rpmsg_channel *vch = to_virtio_rpmsg_channel(rpdev);
+	struct virtproc_info *vrp = vch->vrp;
+
+	return __rpmsg_create_channel(vrp, chinfo);
+}
+
+static int virtio_rpmsg_release_channel(struct rpmsg_device *rpdev,
+					struct rpmsg_channel_info *chinfo)
+{
+	struct virtio_rpmsg_channel *vch = to_virtio_rpmsg_channel(rpdev);
+	struct virtproc_info *vrp = vch->vrp;
+
+	return rpmsg_unregister_device(&vrp->vdev->dev, chinfo);
+}
+
 static struct rpmsg_endpoint *virtio_rpmsg_create_ept(struct rpmsg_device *rpdev,
 						      rpmsg_rx_cb_t cb,
 						      void *priv,
@@ -377,6 +399,8 @@ static int virtio_rpmsg_announce_destroy(struct rpmsg_device *rpdev)
 }
 
 static const struct rpmsg_device_ops virtio_rpmsg_ops = {
+	.create_channel = virtio_rpmsg_create_channel,
+	.release_channel = virtio_rpmsg_release_channel,
 	.create_ept = virtio_rpmsg_create_ept,
 	.announce_create = virtio_rpmsg_announce_create,
 	.announce_destroy = virtio_rpmsg_announce_destroy,
-- 
2.25.1


  parent reply	other threads:[~2020-09-22  0:10 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  0:09 [PATCH 00/10] rpmsg: Make RPMSG name service modular Mathieu Poirier
2020-09-22  0:09 ` [PATCH 01/10] rpmsg: virtio: rename rpmsg_create_channel Mathieu Poirier
2020-09-22  7:06   ` Guennadi Liakhovetski
2020-09-22 19:22     ` Mathieu Poirier
2020-09-22  0:09 ` [PATCH 02/10] rpmsg: core: Add channel creation internal API Mathieu Poirier
2020-09-30  6:35   ` Guennadi Liakhovetski
2020-10-01 14:46     ` Arnaud POULIQUEN
2020-09-22  0:09 ` Mathieu Poirier [this message]
2020-09-22  0:09 ` [PATCH 04/10] rpmsg: Move common structures and defines to headers Mathieu Poirier
2020-09-22 14:26   ` Arnaud POULIQUEN
2020-09-22 19:36     ` Mathieu Poirier
2020-09-30  6:54   ` Guennadi Liakhovetski
2020-09-22  0:09 ` [PATCH 05/10] rpmsg: virtio: Move virtio RPMSG structures to private header Mathieu Poirier
2020-09-22 14:27   ` Arnaud POULIQUEN
2020-09-30  7:03   ` Guennadi Liakhovetski
2020-10-07 17:14     ` Mathieu Poirier
2020-09-22  0:09 ` [PATCH 06/10] rpmsg: Turn name service into a stand alone driver Mathieu Poirier
2020-09-23  1:23   ` kernel test robot
2020-09-23  1:23     ` kernel test robot
2020-09-30  7:09   ` Guennadi Liakhovetski
2020-10-01 16:14     ` Arnaud POULIQUEN
2020-09-22  0:09 ` [PATCH 07/10] rpmsg: virtio: use rpmsg ns device for the ns announcement Mathieu Poirier
2020-09-22  0:09 ` [PATCH 08/10] rpmsg: core: Add RPMSG byte conversion operations Mathieu Poirier
2020-09-22  1:07   ` Randy Dunlap
2020-09-22 14:34   ` Arnaud POULIQUEN
2020-09-22 19:46     ` Mathieu Poirier
2020-09-23 11:56   ` Dan Carpenter
2020-09-23 11:56     ` Dan Carpenter
2020-09-23 11:56     ` Dan Carpenter
2020-09-30  7:11   ` Guennadi Liakhovetski
2020-09-22  0:09 ` [PATCH 09/10] rpmsg: virtio: Make endianness conversion virtIO specific Mathieu Poirier
2020-09-23  1:08   ` kernel test robot
2020-09-23  1:08     ` kernel test robot
2020-09-22  0:10 ` [PATCH 10/10] rpmsg: ns: Make Name service module transport agnostic Mathieu Poirier
2020-09-23  2:39   ` kernel test robot
2020-09-23  2:39     ` kernel test robot
2020-09-30  7:13   ` Guennadi Liakhovetski
2020-10-07 17:26     ` Mathieu Poirier
2020-09-22  8:09 ` [PATCH 00/10] rpmsg: Make RPMSG name service modular Guennadi Liakhovetski
2020-09-22 19:12   ` Mathieu Poirier
2020-09-24  6:53     ` Guennadi Liakhovetski
2020-09-24 18:18       ` Mathieu Poirier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200922001000.899956-4-mathieu.poirier@linaro.org \
    --to=mathieu.poirier@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=guennadi.liakhovetski@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=loic.pallardy@st.com \
    --cc=ohad@wizery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.