Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3812716pxu; Tue, 20 Oct 2020 00:44:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP+ud4dEpqLJsRpojsS0pkSD/PKRvrEEHbaZnxBSt6qq5y6VGssSq7rsWUiFJXu2BbpPLa X-Received: by 2002:a17:906:14db:: with SMTP id y27mr1963770ejc.148.1603179878028; Tue, 20 Oct 2020 00:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603179878; cv=none; d=google.com; s=arc-20160816; b=b0dxSu/ah9R+5/5R5fmJZq3qUQMAIGrMFGUb90Bp3H7F+42tWqy4zWL1vgILASggiy 7KCgno1zU5570isEftAt5o+zim3uwYB/grvuQn4aEuvqqlYNw+rFiPddGDWdEWC/ySwO o7TpW5d37rFQdVlfLL0n7Zp36H4v/UN3CIobSv6KZiBzAptenoZfBK+gFipoZ2io5kb3 hVSK0/FPgzZkWOS+Sik8+oMbgjVWOjzhAr9Rsr+sCU3wRwF/Sm7c+igCqut4fJOIa4+/ KV5bWlk0v6z5IC3e8pMdslcZGMyKJqwMTs/ua4NQOKVzAEZA87Gsjv5b5+m5+zdPCqGO vymA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Hcw4U5lmOg9HxNvVnMS7hY/n1r7F8V4+oMdjBv27lK4=; b=eYfybu4SzrooIrZ2KpVP3AC76GrMGWqnNrEyizt0xXwjfrr7EiScm8XbjeNBlVbUpq LOfXc1eb65wfDweQmdrN8Da6/YbQq9Ywy0hJiLtr5jYnnqAszQeTmd2eHujMESwIvObh OSlxwWTlLyBhuoVbaan7wfDWNy8DJ9f8/5bA3i7bq46C3LyvJBwrt0Tmg60H64KUP8UQ FATYlqaLdSsnN26I5qKDCFXtwfJ8FPuh98ZLIfIS/b4ygursQFAtQSTydlqesZ9q+iCR 3WsYFjNeRDom1WWfhksIXWadjVHWQ7sd2KShvi98V3Yna9WQCydTk3qb+oJWpr25sodh vrbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Urd5EVhT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 23si703819ejx.661.2020.10.20.00.44.16; Tue, 20 Oct 2020 00:44:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Urd5EVhT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731796AbgJSUfB (ORCPT + 99 others); Mon, 19 Oct 2020 16:35:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731754AbgJSUes (ORCPT ); Mon, 19 Oct 2020 16:34:48 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C0A8C0613CE for ; Mon, 19 Oct 2020 13:34:48 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id o9so394452plx.10 for ; Mon, 19 Oct 2020 13:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Hcw4U5lmOg9HxNvVnMS7hY/n1r7F8V4+oMdjBv27lK4=; b=Urd5EVhT41rvG7Mnt4AG1Rtiw5V6LWrfvy17Y3/TbOk0A0E8aysZU2M5/JlcTArcFF yYVYMpPaR8np9vwh7QW6mUVOibQUdZ74AesDZhovXf63dxLwg7c8GC+LiK0Yg2kyw9EL rpoWyUa7Mu/eSdfWoG0MZAfNJAC0A3kRgFrW7rLJMDKsrsgaR+QEsPITfgxC82tiDp8r RXuwNT0DH+YiFtSAd8BYTGegDHHW0VM+k902hrVD0DfAfzXi+weieXhwxfs73ZKZ/gFr 5Jt+hG17x/rLEA/IG1fH2lViSx7vujYldipOHvauHfntvEq6CIT12GFhFiZJ1xac5bM2 7ivg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hcw4U5lmOg9HxNvVnMS7hY/n1r7F8V4+oMdjBv27lK4=; b=Boew1naXmcgf0q0DfVxpwAzjU1uBS29tFrtP3U3j7a4rtcTP9Fvh90L103CsguDFlS WxC/7SkuqqDIH0umssNzNdQcRV0fwm+dpw6msv2FDxE/Cdbeurs0ExigoaRo8FtC4QXQ 4F5M8E+PpmxG/mRQEctME7+7ECpNhUVsY5Mi3XR7GjWpee9CPwqHzZFRo26L55W2YAJ9 NnOyxLaAqSwFWEVPYfEax4Uv2F1GetPlZ+KFyEj4TZ1Qj12RUuK/AnC/xb/nWX+Pfo6s ksdyjqQqO04hZqaGwvn6pHt/kno9xk5LsMBo6bNWMScPRVviq9WuEX0AzrT87u8ehrRA 3+Vw== X-Gm-Message-State: AOAM532jTyh4QyAPUxIbJ6fmz/svQyPkfN7K07Sq+qG4Gzj7C+xzVUyg cYNyaHHlHUdApfanBje8F3wAEg== X-Received: by 2002:a17:902:7fc5:b029:d3:f0da:ade with SMTP id t5-20020a1709027fc5b02900d3f0da0ademr1387077plb.63.1603139687680; Mon, 19 Oct 2020 13:34:47 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id q123sm631847pfq.56.2020.10.19.13.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 13:34:47 -0700 (PDT) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: guennadi.liakhovetski@linux.intel.com, arnaud.pouliquen@st.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/8] rpmsg: virtio: Add rpmsg channel device ops Date: Mon, 19 Oct 2020 14:34:36 -0600 Message-Id: <20201019203438.501174-7-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201019203438.501174-1-mathieu.poirier@linaro.org> References: <20201019203438.501174-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaud Pouliquen Implement the create and release of the RPMsg channel for the RPMsg virtio bus. Signed-off-by: Arnaud Pouliquen Signed-off-by: Mathieu Poirier Reviewed-by: Guennadi Liakhovetski --- drivers/rpmsg/virtio_rpmsg_bus.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index bd5baa0dfcfb..e14390a81265 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -146,6 +146,8 @@ 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, @@ -250,6 +252,24 @@ 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, @@ -342,6 +362,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